primaryPlayerProvider top-level property

StateNotifierProvider<PlayerStateNotifier, PlayerState?> primaryPlayerProvider
final

Implementation

final primaryPlayerProvider = StateNotifierProvider<PlayerStateNotifier, PlayerState?>((ref) {
  final playerNotifier = ref.watch(
    pluginStateProvider.select((value) => value.players[value.primaryPlayerId]),
  );
  if (playerNotifier == null) return PlayerStateNotifier(keepAlive: false);
  return playerNotifier;
});