import 'dart:async';

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/dependency_injection/get_it.dart';
import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/flavors/flavor.dart';
import 'package:{{#snakeCase}}{{project_name}}{{/snakeCase}}/core/utils/app_bloc_observer.dart';

Future<void> bootstrap(FutureOr<Widget> Function() builder) async {
  final widgetsBinding = WidgetsFlutterBinding.ensureInitialized();
  // FlutterNativeSplash.preserve(widgetsBinding: widgetsBinding);

  Bloc.observer = AppBlocObserver();

  debugPrint('Flavor: ${Flavor.get()}');

  await GetItInitializer.init();

  runApp(await builder());
}
