33 lines
864 B
Dart
33 lines
864 B
Dart
// Author: Hugo Pointcheval
|
|
// Email: git@pcl.ovh
|
|
// -----
|
|
// File: bootstrap.dart
|
|
// Created Date: 19/08/2022 15:05:17
|
|
// Last Modified: Fri Nov 11 2022
|
|
// -----
|
|
// Copyright (c) 2022
|
|
|
|
import 'dart:async';
|
|
|
|
import 'package:example_router/core/dependency_injection/get_it.dart';
|
|
import 'package:example_router/core/utils/app_bloc_observer.dart';
|
|
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
|
|
Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
|
|
await runZonedGuarded(
|
|
() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
Bloc.observer = AppBlocObserver();
|
|
|
|
FlutterError.onError = (details) {
|
|
debugPrint(details.toString());
|
|
};
|
|
await GetItInitializer.init();
|
|
|
|
runApp(await builder());
|
|
},
|
|
(error, stackTrace) => debugPrint(error.toString()),
|
|
);
|
|
}
|