BASE: Add Necessary Assets.
This commit is contained in:
125
lib/main.dart
125
lib/main.dart
@@ -6,6 +6,7 @@ import 'package:customer/utils/preferences.dart';
|
||||
import 'package:firebase_core/firebase_core.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'controllers/global_setting_controller.dart';
|
||||
import 'controllers/theme_controller.dart';
|
||||
@@ -13,7 +14,10 @@ import 'firebase_options.dart';
|
||||
|
||||
void main() async {
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
await Firebase.initializeApp(name: 'default', options: DefaultFirebaseOptions.currentPlatform);
|
||||
await Firebase.initializeApp(
|
||||
name: 'default',
|
||||
options: DefaultFirebaseOptions.currentPlatform,
|
||||
);
|
||||
|
||||
await Preferences.initPref();
|
||||
|
||||
@@ -32,54 +36,79 @@ class MyApp extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
Get.put(ThemeController());
|
||||
return Obx(
|
||||
() => GetMaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: (context, child) {
|
||||
return SafeArea(bottom: true, top: false, child: EasyLoading.init()(context, child));
|
||||
},
|
||||
translations: LocalizationService(),
|
||||
locale: LocalizationService.locale,
|
||||
fallbackLocale: LocalizationService.locale,
|
||||
themeMode: themeController.themeMode,
|
||||
theme: ThemeData(
|
||||
scaffoldBackgroundColor: AppThemeData.surface,
|
||||
textTheme: TextTheme(bodyLarge: TextStyle(color: AppThemeData.grey900)),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppThemeData.surface,
|
||||
foregroundColor: AppThemeData.grey900,
|
||||
iconTheme: IconThemeData(color: AppThemeData.grey900),
|
||||
),
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: AppThemeData.surface,
|
||||
selectedItemColor: AppThemeData.primary300,
|
||||
unselectedItemColor: AppThemeData.grey600,
|
||||
selectedLabelStyle: TextStyle(fontFamily: AppThemeData.bold, fontSize: 12),
|
||||
unselectedLabelStyle: TextStyle(fontFamily: AppThemeData.bold, fontSize: 12),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
),
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
scaffoldBackgroundColor: AppThemeData.surfaceDark,
|
||||
textTheme: TextTheme(bodyLarge: TextStyle(color: AppThemeData.greyDark900)),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppThemeData.surfaceDark,
|
||||
foregroundColor: AppThemeData.greyDark900,
|
||||
iconTheme: IconThemeData(color: AppThemeData.greyDark900),
|
||||
),
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: AppThemeData.grey900,
|
||||
selectedItemColor: AppThemeData.primary300,
|
||||
unselectedItemColor: AppThemeData.grey300,
|
||||
selectedLabelStyle: TextStyle(fontFamily: AppThemeData.bold, fontSize: 12),
|
||||
unselectedLabelStyle: TextStyle(fontFamily: AppThemeData.bold, fontSize: 12),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
),
|
||||
),
|
||||
home: GetBuilder<GlobalSettingController>(
|
||||
init: GlobalSettingController(),
|
||||
builder: (context) {
|
||||
return const SplashScreen();
|
||||
() => ScreenUtilInit(
|
||||
designSize: Size(375, 812),
|
||||
minTextAdapt: true,
|
||||
splitScreenMode: true,
|
||||
child: GetMaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
builder: (context, child) {
|
||||
return SafeArea(
|
||||
bottom: true,
|
||||
top: false,
|
||||
child: EasyLoading.init()(context, child),
|
||||
);
|
||||
},
|
||||
translations: LocalizationService(),
|
||||
locale: LocalizationService.locale,
|
||||
fallbackLocale: LocalizationService.locale,
|
||||
themeMode: themeController.themeMode,
|
||||
theme: ThemeData(
|
||||
scaffoldBackgroundColor: AppThemeData.surface,
|
||||
textTheme: TextTheme(
|
||||
bodyLarge: TextStyle(color: AppThemeData.grey900),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppThemeData.surface,
|
||||
foregroundColor: AppThemeData.grey900,
|
||||
iconTheme: IconThemeData(color: AppThemeData.grey900),
|
||||
),
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: AppThemeData.surface,
|
||||
selectedItemColor: AppThemeData.primary300,
|
||||
unselectedItemColor: AppThemeData.grey600,
|
||||
selectedLabelStyle: TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 12,
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 12,
|
||||
),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
),
|
||||
),
|
||||
darkTheme: ThemeData(
|
||||
scaffoldBackgroundColor: AppThemeData.surfaceDark,
|
||||
textTheme: TextTheme(
|
||||
bodyLarge: TextStyle(color: AppThemeData.greyDark900),
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppThemeData.surfaceDark,
|
||||
foregroundColor: AppThemeData.greyDark900,
|
||||
iconTheme: IconThemeData(color: AppThemeData.greyDark900),
|
||||
),
|
||||
bottomNavigationBarTheme: BottomNavigationBarThemeData(
|
||||
backgroundColor: AppThemeData.grey900,
|
||||
selectedItemColor: AppThemeData.primary300,
|
||||
unselectedItemColor: AppThemeData.grey300,
|
||||
selectedLabelStyle: TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 12,
|
||||
),
|
||||
unselectedLabelStyle: TextStyle(
|
||||
fontFamily: AppThemeData.bold,
|
||||
fontSize: 12,
|
||||
),
|
||||
type: BottomNavigationBarType.fixed,
|
||||
),
|
||||
),
|
||||
home: GetBuilder<GlobalSettingController>(
|
||||
init: GlobalSettingController(),
|
||||
builder: (context) {
|
||||
return const SplashScreen();
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user