@@ -10,20 +10,23 @@ import '../../../shared/ui/colors.dart';
1010import '../bloc/group_info_bloc.dart' ;
1111import 'group_info_form.dart' ;
1212
13+ typedef GroupInfoPageCallback = void Function (bool result);
14+
1315class GroupInfoPage extends StatelessWidget {
1416 final ConversationModel conversation;
17+ final GroupInfoPageCallback ? onResult;
1518
16- const GroupInfoPage ({required this .conversation, super .key});
19+ const GroupInfoPage ({required this .conversation, this .onResult, super .key});
1720
18- static BlocProvider route (Object ? extra) {
21+ static BlocProvider route (Object ? extra, { GroupInfoPageCallback ? onResult} ) {
1922 ConversationModel conversation = extra as ConversationModel ;
2023
2124 return BlocProvider <GroupInfoBloc >(
2225 create: (context) => GroupInfoBloc (
2326 RepositoryProvider .of <ConversationRepository >(context),
2427 RepositoryProvider .of <UserRepository >(context),
2528 conversation: conversation),
26- child: GroupInfoPage (conversation: conversation),
29+ child: GroupInfoPage (conversation: conversation, onResult : onResult ),
2730 );
2831 }
2932
@@ -32,15 +35,17 @@ class GroupInfoPage extends StatelessWidget {
3235 return BlocBuilder <GroupInfoBloc , GroupInfoState >(
3336 builder: (context, state) {
3437 return PopScope (
35- canPop: false ,
38+ onPopInvokedWithResult: (didPop, result) {
39+ onResult? .call (state.status.isSuccess);
40+ },
3641 child: Scaffold (
3742 backgroundColor: black,
3843 resizeToAvoidBottomInset: false ,
3944 appBar: AppBar (
4045 backgroundColor: black,
4146 leading: IconButton (
4247 icon: const Icon (Icons .arrow_back_outlined, color: white),
43- onPressed: () => context.pop (state.status.isSuccess ),
48+ onPressed: () => context.pop (),
4449 ),
4550 title: Text (
4651 state.name.value,
0 commit comments