connect method
Connects to the backend
Implementation
@override
Future<void> connect() async {
logger.info('Connecting, to $address');
socket.on(IOChannel.connection.string, (_) {
ref.read(GameProviders.connected.notifier).state = true;
});
socket.on(IOChannel.disconnect.string, (_) {
ref.read(GameProviders.connected.notifier).state = false;
});
if (socket.connected) {
ref.read(GameProviders.connected.notifier).state = true;
}
logger.info('Created ServerClient');
}