Reduce Android and iOS background work

This commit is contained in:
shen
2026-12-03 16:46:29 -08:00
parent 9e05f1ad93
commit e68cb6c909
12 changed files with 189 additions and 60 deletions
@@ -0,0 +1,9 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
bool get usesMobileLifecycle =>
defaultTargetPlatform == TargetPlatform.android ||
defaultTargetPlatform == TargetPlatform.iOS;
bool shouldRefreshUi(AppLifecycleState? state) =>
!usesMobileLifecycle || state == null || state == AppLifecycleState.resumed;