From f4846750083db1ad79840f0d36a49471dc252b7e Mon Sep 17 00:00:00 2001 From: "Lucas.Xu" Date: Thu, 7 Mar 2024 09:28:31 +0800 Subject: [PATCH] fix: uninitialized error in members setting page (#4834) --- .../home/menu/sidebar/workspace/_sidebar_workspace_menu.dart | 3 +-- .../settings/widgets/members/workspace_member_bloc.dart | 2 ++ .../settings/widgets/members/workspace_member_page.dart | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart index c02b2ad22e..b2ab95638e 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/home/menu/sidebar/workspace/_sidebar_workspace_menu.dart @@ -113,8 +113,7 @@ class WorkspaceMenuItem extends StatelessWidget { return BlocProvider( create: (_) => WorkspaceMemberBloc(userProfile: userProfile, workspace: workspace) - ..add(const WorkspaceMemberEvent.initial()) - ..add(const WorkspaceMemberEvent.getWorkspaceMembers()), + ..add(const WorkspaceMemberEvent.initial()), child: BlocBuilder( builder: (context, state) { final members = state.members; diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart index 2d9397d7cf..aaa63c3b9b 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_bloc.dart @@ -38,6 +38,8 @@ class WorkspaceMemberBloc workspaceId = ''; }); } + + add(const WorkspaceMemberEvent.getWorkspaceMembers()); }, getWorkspaceMembers: () async { final members = await _getWorkspaceMembers(); diff --git a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_page.dart b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_page.dart index 724c9ad2be..14ff872cdb 100644 --- a/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_page.dart +++ b/frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/members/workspace_member_page.dart @@ -27,9 +27,7 @@ class WorkspaceMembersPage extends StatelessWidget { Widget build(BuildContext context) { return BlocProvider( create: (context) => WorkspaceMemberBloc(userProfile: userProfile) - ..add( - const WorkspaceMemberEvent.getWorkspaceMembers(), - ), + ..add(const WorkspaceMemberEvent.initial()), child: BlocBuilder( builder: (context, state) { return SingleChildScrollView(