feat: refactor financial wallet UI components and add offline map service support
This commit is contained in:
@@ -35,6 +35,7 @@ import 'print.dart';
|
||||
import 'splash_screen_page.dart';
|
||||
import 'views/home/Captin/orderCaptin/order_request_page.dart';
|
||||
import 'views/home/Captin/driver_map_page.dart';
|
||||
import 'controller/profile/setting_controller.dart';
|
||||
|
||||
final box = GetStorage();
|
||||
const storage = FlutterSecureStorage();
|
||||
@@ -315,10 +316,15 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
|
||||
Future<void> _initApp() async {
|
||||
try {
|
||||
if (!Get.isRegistered<NotificationController>())
|
||||
if (!Get.isRegistered<NotificationController>()) {
|
||||
Get.put(NotificationController());
|
||||
if (!Get.isRegistered<FirebaseMessagesController>())
|
||||
}
|
||||
if (!Get.isRegistered<FirebaseMessagesController>()) {
|
||||
Get.put(FirebaseMessagesController()).getToken();
|
||||
}
|
||||
if (!Get.isRegistered<SettingController>()) {
|
||||
Get.put(SettingController());
|
||||
}
|
||||
await FirebaseMessaging.instance.requestPermission();
|
||||
await NotificationController().initNotifications();
|
||||
|
||||
@@ -433,12 +439,15 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
|
||||
print("📥 Server Response: $res");
|
||||
|
||||
if (Get.isDialogOpen == true) Get.back();
|
||||
// إغلاق أي ديالوج مفتوح باستخدام المفتاح العالمي لضمان الموثوقية
|
||||
if (Get.isDialogOpen == true) {
|
||||
navigatorKey.currentState?.pop();
|
||||
}
|
||||
|
||||
bool isFailure = false;
|
||||
if (res is Map && res['status'] == 'failure')
|
||||
if (res is Map && res['status'] == 'failure') {
|
||||
isFailure = true;
|
||||
else if (res == 'failure') isFailure = true;
|
||||
} else if (res == 'failure') isFailure = true;
|
||||
|
||||
if (isFailure) {
|
||||
Get.defaultDialog(
|
||||
@@ -465,7 +474,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
|
||||
Get.offAll(() => PassengerLocationMapPage(), arguments: rideArgs);
|
||||
} catch (e) {
|
||||
if (Get.isDialogOpen == true) Get.back();
|
||||
if (Get.isDialogOpen == true) {
|
||||
navigatorKey.currentState?.pop();
|
||||
}
|
||||
print("❌ Error in accept process: $e");
|
||||
Get.snackbar("خطأ", "حدث خطأ غير متوقع");
|
||||
}
|
||||
@@ -511,13 +522,18 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final LocaleController localController = Get.put(LocaleController());
|
||||
final SettingController settingController = Get.put(SettingController());
|
||||
|
||||
return GetMaterialApp(
|
||||
navigatorKey: navigatorKey,
|
||||
title: AppInformation.appName,
|
||||
translations: MyTranslation(),
|
||||
debugShowCheckedModeBanner: false,
|
||||
locale: localController.language,
|
||||
theme: localController.appTheme,
|
||||
theme: localController.lightTheme,
|
||||
darkTheme: localController.darkTheme,
|
||||
themeMode: settingController.isDarkMode ? ThemeMode.dark : ThemeMode.light,
|
||||
|
||||
initialRoute: '/',
|
||||
getPages: [
|
||||
GetPage(name: '/', page: () => SplashScreen()),
|
||||
@@ -529,3 +545,4 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user