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