| 1 | import 'package:mapbox_maps_flutter/mapbox_maps_flutter.dart'; |
| 2 | import 'package:plane_pal/constants/main.dart'; |
| 3 | import 'package:plane_pal/notifiers/user.dart'; |
| 4 | import 'package:plane_pal/routes/main.dart'; |
| 5 | import 'package:flutter/material.dart'; |
| 6 | import 'package:provider/provider.dart'; |
| 7 | import 'package:toastification/toastification.dart'; |
| 8 | |
| 9 | void main() async { |
| 10 | WidgetsFlutterBinding.ensureInitialized(); |
| 11 | MapboxOptions.setAccessToken(MAPBOX_API_KEY |
| 12 | runApp( |
| 13 | MultiProvider( |
| 14 | providers: [ |
| 15 | ChangeNotifierProvider( |
| 16 | create: (context) { |
| 17 | return UserNotifier(); |
| 18 | }, |
| 19 | ) |
| 20 | ], |
| 21 | child: const MainApp() |
| 22 | ), |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | class MainApp extends StatelessWidget |
| 27 | const MainApp({super |
| 28 | |
| 29 | @override |
| 30 | Widget build(BuildContext |
| 31 | return ToastificationWrapper( |
| 32 | child: MaterialApp.router( |
| 33 | routerConfig: AeroRouter.router, |
| 34 | debugShowCheckedModeBanner: false, |
| 35 | theme: ThemeData( |
| 36 | useMaterial3: true, |
| 37 | scaffoldBackgroundColor: Colors.white, |
| 38 | fontFamily: "Geist", |
| 39 | brightness: Brightness.light, |
| 40 | primaryColor: Colors.blueAccent, |
| 41 | navigationBarTheme: NavigationBarThemeData( |
| 42 | labelTextStyle: const WidgetStatePropertyAll( |
| 43 | TextStyle( |
| 44 | fontSize: 14, |
| 45 | ), |
| 46 | ), |
| 47 | backgroundColor: const Color( |
| 48 | indicatorColor: Colors.blueAccent.withValues |
| 49 | alpha: .4, |
| 50 | ), |
| 51 | ), |
| 52 | appBarTheme: const AppBarTheme( |
| 53 | elevation: 0, |
| 54 | scrolledUnderElevation: 0, |
| 55 | titleTextStyle: TextStyle( |
| 56 | fontFamily: "CalSans", |
| 57 | fontSize: 20, |
| 58 | color: Colors.black, |
| 59 | ), |
| 60 | toolbarHeight: 50, |
| 61 | backgroundColor: Colors.white, |
| 62 | ), |
| 63 | textTheme: const TextTheme( |
| 64 | labelMedium: TextStyle( |
| 65 | fontSize: 20, |
| 66 | ), |
| 67 | titleLarge: TextStyle( |
| 68 | fontSize: 32, |
| 69 | fontWeight: FontWeight.bold, |
| 70 | ), |
| 71 | titleSmall: TextStyle( |
| 72 | fontSize: 16, |
| 73 | color: SECONDARY_TEXT_COLOR, |
| 74 | ), |
| 75 | titleMedium: TextStyle( |
| 76 | fontSize: 20, |
| 77 | ), |
| 78 | bodyMedium: TextStyle( |
| 79 | color: Colors.black87, |
| 80 | fontSize: 14, |
| 81 | ), |
| 82 | ), |
| 83 | elevatedButtonTheme: ElevatedButtonThemeData( |
| 84 | style: ElevatedButton.styleFrom( |
| 85 | backgroundColor: Colors.blueAccent, |
| 86 | foregroundColor: Colors.black, |
| 87 | shape: RoundedRectangleBorder( |
| 88 | borderRadius: BorderRadius.circular( |
| 89 | 10, |
| 90 | ), |
| 91 | ), |
| 92 | ), |
| 93 | ), |
| 94 | outlinedButtonTheme: OutlinedButtonThemeData( |
| 95 | style: OutlinedButton.styleFrom( |
| 96 | foregroundColor: Colors.black, |
| 97 | side: const BorderSide( |
| 98 | color: Colors.blueAccent, |
| 99 | width: 2, |
| 100 | ), |
| 101 | shape: RoundedRectangleBorder( |
| 102 | borderRadius: BorderRadius.circular( |
| 103 | ), |
| 104 | padding: const EdgeInsets. |
| 105 | vertical: 12, |
| 106 | horizontal: 16, |
| 107 | ), |
| 108 | ), |
| 109 | ), |
| 110 | ), |
| 111 | ), |
| 112 | ); |
| 113 | } |
| 114 | } |