forked from eatvio/eatvio_app
62 lines
2.2 KiB
Dart
62 lines
2.2 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:eatvio_app/features/video_calls/services/video_call_callkit_coordinator.dart';
|
|
import 'package:eatvio_app/features/video_calls/services/video_call_foreground_bootstrap.dart';
|
|
import 'package:eatvio_app/features/video_calls/presentation/widgets/video_call_app_shell.dart';
|
|
import 'dart:async';
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_foreground_task/flutter_foreground_task.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();
|
|
FlutterForegroundTask.initCommunicationPort();
|
|
VideoCallForegroundBootstrap.ensureInitialized();
|
|
await AppInitializer.initialize(buildType: AppBuildType.prod);
|
|
await sl<VideoCallCallKitCoordinator>().initialize();
|
|
await PushNavigationHandler.initialize();
|
|
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();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MultiBlocProvider(
|
|
providers: sl<AppConfig>().globalBlocProviders,
|
|
child: Portal(
|
|
child: KeyboardDismisser(
|
|
child: WithForegroundTask(
|
|
child: MaterialApp.router(
|
|
theme: ThemeHelper().themeData(),
|
|
routerConfig: AppRouter.appRouter,
|
|
debugShowCheckedModeBanner: false,
|
|
localizationsDelegates: sl<AppConfig>().localizationDelegates,
|
|
supportedLocales: sl<AppConfig>().supportedLocales,
|
|
builder: (context, child) => VideoCallAppShell(child: child),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|