status property

StateProvider<GameStatus?> status
final

Provides the game status for the current game of the client with specified id

Implementation

static final status = StateProvider<GameStatus?>(
  (ref) {
    final status = ref.watch(lobby).asData?.value.status;
    if (status == null) {
      return null;
    } else if (status == GameStatus.Started) {
      return ref.watch(game).asData?.value.status ?? GameStatus.Lobby;
    } else {
      return status;
    }
  },
  name: 'GameStatus',
  dependencies: [playerID, lobby, game],
);