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