didChangeAppLifecycleState method
- AppLifecycleState state
override
Respond to changes in the app lifecycle state, on iOS
Restart timer if resumed; else cancel it
Implementation
void didChangeAppLifecycleState(AppLifecycleState state) {
if (!Platform.isIOS) return;
if (state == AppLifecycleState.resumed) {
_refreshTimer ??= Timer.periodic(_refreshPeriod, _refresh);
_refresh();
} else {
_refreshTimer?.cancel();
_refreshTimer = null;
}
}