Skip to content

Commit

Permalink
community join
Browse files Browse the repository at this point in the history
  • Loading branch information
Sahira100 committed Jan 27, 2024
1 parent 119b6bc commit 3b70f84
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions code/smartchessboard/lib/screens/join_community.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,30 @@ class _JoinCommunityScreenState extends State<JoinCommunityScreen> {
void run(String nickname, String profileId) {
print(nickname);
print(profileId);

showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(
"${nickname}?"+" has sent invitation"),
actions: [
TextButton(
onPressed: () {
_socketMethods.communityGameAcceptorWithdrawReply(profileId, true);
},
child: Text("Accept"),
),
TextButton(
onPressed: () {
_socketMethods.communityGameAcceptorWithdrawReply(profileId, false);
},
child: Text("Reject"),
),
],
);
},
);
}

@override
Expand Down Expand Up @@ -175,6 +199,7 @@ class _JoinCommunityScreenState extends State<JoinCommunityScreen> {
);
},
child: ListTile(

tileColor: Color.fromARGB(255, 240, 240, 240),
title: Text(
'${index + 1}. ${onlinePlayers[index].nickname}',
Expand Down

0 comments on commit 3b70f84

Please sign in to comment.