Fixes & Updates - 2026-06-01: Integrate Back-End v3 updates, fix call/connection issues across apps

This commit is contained in:
Hamza-Ayed
2026-06-01 23:35:29 +03:00
parent 8f555691b9
commit cbf693c804
56 changed files with 6091 additions and 1217 deletions

View File

@@ -36,6 +36,7 @@ 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';
import 'controller/voice_call_controller.dart';
final box = GetStorage();
const storage = FlutterSecureStorage();
@@ -325,6 +326,9 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
if (!Get.isRegistered<SettingController>()) {
Get.put(SettingController());
}
if (!Get.isRegistered<VoiceCallController>()) {
Get.lazyPut(() => VoiceCallController(), fenix: true);
}
await FirebaseMessaging.instance.requestPermission();
await NotificationController().initNotifications();
@@ -394,6 +398,10 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
String? savedTrip = await storage.read(key: 'pending_driver_list');
if (savedTrip != null && savedTrip.isNotEmpty) {
if (Get.currentRoute == '/') {
print('⏳ App is still on Splash screen. Postponing notification trip navigation to HomeCaptainController.');
return;
}
await storage.delete(key: 'pending_driver_list');
List<dynamic> driverList = jsonDecode(savedTrip);
@@ -461,7 +469,7 @@ class _MyAppState extends State<MyApp> with WidgetsBindingObserver {
}
if (!Get.isRegistered<HomeCaptainController>()) {
Get.put(HomeCaptainController());
Get.put(HomeCaptainController(), permanent: true);
} else {
Get.find<HomeCaptainController>().changeRideId();
}