initGameStateListener static method

  1. @visibleForTesting
void initGameStateListener(
  1. Game currentGame,
  2. void onGameStateChange()
)

Implementation

@visibleForTesting
static void initGameStateListener(
  Game currentGame,
  void Function() onGameStateChange,
) {
  currentGame.addGameStateListener(onGameStateChange);

  // See https://github.com/flame-engine/flame/issues/2771
  // for why we aren't using [WidgetsBinding.instance.lifecycleState].
  currentGame.lifecycleStateChange(AppLifecycleState.resumed);
}