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();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
MediaKit.ensureInitialized();
|
MediaKit.ensureInitialized();
|
||||||
|
|
||||||
isInBackground =
|
|
||||||
Platform.environment["FLUTTER_HEADLESS"] != null ||
|
|
||||||
args.contains("--unifiedpush-bg");
|
|
||||||
|
|
||||||
LicenseRegistry.addLicense(() => .fromIterable(fontLicenses));
|
LicenseRegistry.addLicense(() => .fromIterable(fontLicenses));
|
||||||
|
|
||||||
FlutterError.onError = (FlutterErrorDetails details) =>
|
FlutterError.onError = (FlutterErrorDetails details) =>
|
||||||
showError(details.exception.toString(), details.stack);
|
showError(details.exception.toString(), details.stack);
|
||||||
|
|
||||||
|
isInBackground =
|
||||||
|
Platform.environment["FLUTTER_HEADLESS"] != null ||
|
||||||
|
args.contains("--unifiedpush-bg");
|
||||||
|
|
||||||
if (isInBackground) {
|
if (isInBackground) {
|
||||||
await ProviderContainer()
|
await ProviderContainer()
|
||||||
.read(UnifiedPushController.provider.future)
|
.read(UnifiedPushController.provider.future)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue