move isInBackground in main
This commit is contained in:
parent
0636366359
commit
38fd19ad1a
1 changed files with 4 additions and 4 deletions
|
|
@ -71,15 +71,15 @@ void main(List<String> args) async {
|
|||
WidgetsFlutterBinding.ensureInitialized();
|
||||
MediaKit.ensureInitialized();
|
||||
|
||||
isInBackground =
|
||||
Platform.environment["FLUTTER_HEADLESS"] != null ||
|
||||
args.contains("--unifiedpush-bg");
|
||||
|
||||
LicenseRegistry.addLicense(() => .fromIterable(fontLicenses));
|
||||
|
||||
FlutterError.onError = (FlutterErrorDetails details) =>
|
||||
showError(details.exception.toString(), details.stack);
|
||||
|
||||
isInBackground =
|
||||
Platform.environment["FLUTTER_HEADLESS"] != null ||
|
||||
args.contains("--unifiedpush-bg");
|
||||
|
||||
if (isInBackground) {
|
||||
await ProviderContainer()
|
||||
.read(UnifiedPushController.provider.future)
|
||||
|
|
|
|||
Loading…
Reference in a new issue