appLifecycleStateChanged method

  1. @override
void appLifecycleStateChanged(
  1. AppLifecycleState previous,
  2. AppLifecycleState current
)
override

Implementation

@override
void appLifecycleStateChanged(
  AppLifecycleState previous,
  AppLifecycleState current,
) {
  // When the app is backgrounded or foregrounded, reset inputs to avoid
  // any weirdness with tap/key state getting out of sync.
  _tapInput.reset();
  _keyboardInput.keysDown.clear();
  pressedTime = 0;
  justPressed = false;
}