Reduce Android and iOS background work
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user