Skip to content

Commit

Permalink
communityGameAcceptorWithdrawReply
Browse files Browse the repository at this point in the history
  • Loading branch information
udayaKavinda committed Jan 27, 2024
1 parent 1a24a73 commit 1c09ed1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions code/smartchessboard/lib/resources/socket_methods.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:ffi';

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smartchessboard/provider/profile_data_provider.dart';
Expand Down Expand Up @@ -60,6 +62,19 @@ class SocketMethods {
});
}

void communityGameAcceptorWithdrawReply(String profileId, Bool reply) {
_socketClient.emit("communityGameAcceptorWithdrawReply",
{'profileId': profileId, 'accept': reply});
}

void initCommunityGame(BuildContext context) {
_socketClient.on('initCommunity', (room) {
Provider.of<RoomDataProvider>(context, listen: false)
.updateRoomData(room);
Navigator.pushNamed(context, GameScreen.routeName);
});
}

void disposeCommunitySockets() {
_socketClient.off('community');
}
Expand Down

0 comments on commit 1c09ed1

Please sign in to comment.