didChangeAppLifecycleState method Null safety

  1. @override
void didChangeAppLifecycleState(
  1. AppLifecycleState state
)
override

Function called when the app changes the lifecycle state. @param state The new app state.

Implementation

@override
void didChangeAppLifecycleState(AppLifecycleState state) {
  if (state != AppLifecycleState.resumed) {
    _sessionManager.endSession();
  } else {
    _sessionManager.startSession().then(
          (_) => updateMetadata(),
        );
  }
}