Skip to content

Commit

Permalink
TW-1734: Update remove from group on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed May 2, 2024
1 parent 2849382 commit edf1488
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class ParticipantListItem extends StatelessWidget {
builder: (ctx) => ProfileInfoPage(
roomId: member.room.id,
userId: member.id,
onUpdatedMembers: onUpdatedMembers,
),
),
);
Expand All @@ -126,6 +127,7 @@ class ParticipantListItem extends StatelessWidget {
return ProfileInfoPage(
roomId: member.room.id,
userId: member.id,
onUpdatedMembers: onUpdatedMembers,
onNewChatOpen: () {
dialogContext.pop();
},
Expand Down
7 changes: 6 additions & 1 deletion lib/pages/profile_info/profile_info_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ class ProfileInfoPage extends StatefulWidget {
required this.roomId,
required this.userId,
this.onNewChatOpen,
this.onUpdatedMembers,
});

final String roomId;
final String userId;
final void Function()? onNewChatOpen;
final VoidCallback? onUpdatedMembers;

@override
State<ProfileInfoPage> createState() => ProfileInfoPageState();
Expand All @@ -25,5 +27,8 @@ class ProfileInfoPageState extends State<ProfileInfoPage> {
User? get user => room?.unsafeGetUserFromMemoryOrFallback(widget.userId);

@override
Widget build(BuildContext context) => ProfileInfoView(this);
Widget build(BuildContext context) => ProfileInfoView(
this,
onUpdatedMembers: widget.onUpdatedMembers,
);
}
4 changes: 4 additions & 0 deletions lib/pages/profile_info/profile_info_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ class ProfileInfoView extends StatelessWidget {
const ProfileInfoView(
this.controller, {
super.key,
this.onUpdatedMembers,
});

final ProfileInfoPageState controller;

final VoidCallback? onUpdatedMembers;

@override
Widget build(BuildContext context) {
return Scaffold(
Expand Down Expand Up @@ -58,6 +61,7 @@ class ProfileInfoView extends StatelessWidget {
body: ProfileInfoBody(
user: controller.user,
onNewChatOpen: controller.widget.onNewChatOpen,
onUpdatedMembers: onUpdatedMembers,
),
);
}
Expand Down

0 comments on commit edf1488

Please sign in to comment.