socketIOGameClient top-level property

Provider<GameClient> socketIOGameClient
final

Implementation

final socketIOGameClient = Provider<GameClient>(
  (ref) {
    final client = IOGameClient(
      code: ref.read(GameProviders.code),
      address: ref.watch(GameProviders.remoteUri),
      ref: ref,
    );
    ref.onDispose(() {
      client.exitGame(
        ref.read(GameProviders.playerID),
        ref.read(GameProviders.code),
      );
      client.dispose();
    });
    return client;
  },
  name: 'socketIOGameClient',
  dependencies: [
    GameProviders.remoteUri,
    GameProviders.code,
    GameProviders.playerID,
  ],
);