currentAppState static method

String currentAppState()

Implementation

static String currentAppState() {
  final appStateMap = <AppLifecycleState, String>{
    AppLifecycleState.resumed: eventKeyAppStateActive,
    AppLifecycleState.inactive: eventKeyAppStateBackground,
    AppLifecycleState.hidden: eventKeyAppStateBackground,
    AppLifecycleState.paused: eventKeyAppStateBackground,
    AppLifecycleState.detached: eventKeyAppStateBackground,
  };

  return appStateMap[WidgetsBinding.instance.lifecycleState] ??
      eventKeyAppStateBackground;
}