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