The order when app go background is: inactive -> hidden -> pause
When go foreground: hidden -> inactive -> resumed
And note that when the device at multitasking state: inactive, so you should catch state == AppLifecycleState.inactive
, not .paused
See the gif below