forked from eatvio/eatvio_app
50 lines
1.5 KiB
Dart
50 lines
1.5 KiB
Dart
import 'package:eatvio_app/core/app_config.dart';
|
|
import 'package:eatvio_app/core/app_initializer.dart';
|
|
import 'package:eatvio_app/core/app_router.dart';
|
|
import 'package:eatvio_app/core/locator_service.dart';
|
|
import 'package:eatvio_app/core/notifications/push_navigation_handler.dart';
|
|
import 'package:eatvio_app/core/theme/theme_helper.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
|
import 'package:flutter_portal/flutter_portal.dart';
|
|
import 'package:keyboard_dismisser/keyboard_dismisser.dart';
|
|
|
|
Future<void> main() async {
|
|
WidgetsFlutterBinding.ensureInitialized();
|
|
await AppInitializer.initialize(buildType: AppBuildType.prod);
|
|
await AppInitializer.runAppWithSentry(() => runApp(const MyApp()));
|
|
}
|
|
|
|
class MyApp extends StatefulWidget {
|
|
const MyApp({super.key});
|
|
|
|
@override
|
|
State<MyApp> createState() => _MyAppState();
|
|
}
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
PushNavigationHandler.initialize();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiBlocProvider(
|
|
providers: sl<AppConfig>().globalBlocProviders,
|
|
child: Portal(
|
|
child: KeyboardDismisser(
|
|
child: MaterialApp.router(
|
|
theme: ThemeHelper().themeData(),
|
|
routerConfig: AppRouter.appRouter,
|
|
debugShowCheckedModeBanner: false,
|
|
localizationsDelegates: sl<AppConfig>().localizationDelegates,
|
|
supportedLocales: sl<AppConfig>().supportedLocales,
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|