didChangeAppLifecycleState method

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

Pause and resume music.

Implementation

@override
void didChangeAppLifecycleState(final AppLifecycleState state) {
  super.didChangeAppLifecycleState(state);
  if (state == AppLifecycleState.paused) {
    handle?.pause();
  } else if (state == AppLifecycleState.resumed) {
    handle?.unpause();
  }
}