Skip to content

Commit

Permalink
run WidgetsFlutterBinding in same zone as the rest of the app
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkbee1 committed Sep 6, 2023
1 parent 1970caf commit 918b17c
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/bootstrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,17 @@ Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
log(details.exceptionAsString(), stackTrace: details.stack);
};

WidgetsFlutterBinding.ensureInitialized();

await LocalNotification().init();
await initSecureStorage;
await runZonedGuarded(
() async {
WidgetsFlutterBinding.ensureInitialized();

/// Disable Http google font
GoogleFonts.config.allowRuntimeFetching = false;
await LocalNotification().init();
await initSecureStorage;

await Dartez().init();
/// Disable Http google font
GoogleFonts.config.allowRuntimeFetching = false;

await runZonedGuarded(
() async {
await Dartez().init();
Bloc.observer = AppBlocObserver();
runApp(await builder());
},
Expand Down

0 comments on commit 918b17c

Please sign in to comment.