This commit is contained in:
Hamza-Ayed
2024-07-16 13:39:47 +03:00
parent 8661bd7f3f
commit 54e92f4aa3
16 changed files with 256 additions and 33 deletions

View File

@@ -134,12 +134,12 @@ class FirebaseMessagesController extends GetxController {
NotificationController()
.showNotification('Promo', 'Show latest promo'.tr, 'promo');
Get.to(const PromosPassengerPage());
} else if (message.notification!.title! == 'Trip Monitoring') {
NotificationController().showNotification(
'Trip Monitoring'.tr, 'Show latest promo'.tr, 'iphone_ringtone');
} else if (message.notification!.title! == 'Trip Monitoring'.tr) {
NotificationController()
.showNotification('Trip Monitoring'.tr, '', 'iphone_ringtone');
var myListString = message.data['passengerList'];
var myList = jsonDecode(myListString) as List<dynamic>;
Get.to(const TripMonitor(), arguments: {
Get.toNamed('/tripmonitor', arguments: {
'rideId': myList[0].toString(),
'driverId': myList[1].toString(),
});
@@ -214,9 +214,11 @@ class FirebaseMessagesController extends GetxController {
onPressed: () {
Get.offAll(() => const MapPagePassenger());
}));
} else if (message.notification!.title! == "Trip Monitoring".tr) {
Get.to(() => const TripMonitor());
} else if (message.notification!.title! == 'Call Income') {
}
// else if (message.notification!.title! == "Trip Monitoring".tr) {
// Get.to(() => const TripMonitor());
// }
else if (message.notification!.title! == 'Call Income') {
try {
var myListString = message.data['passengerList'];
var driverList = jsonDecode(myListString) as List<dynamic>;

View File

@@ -7,14 +7,18 @@ import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';
import '../../constant/box_name.dart';
import '../../constant/info.dart';
import '../../main.dart';
Future<void> checkForUpdate(BuildContext context) async {
final packageInfo = await PackageInfo.fromPlatform();
final currentVersion = packageInfo.buildNumber;
final version = packageInfo.version;
print('currentVersion is : $currentVersion');
// Fetch the latest version from your server
String latestVersion = await getPackageInfo();
box.write(BoxName.packagInfo, version);
if (latestVersion.isNotEmpty && latestVersion != currentVersion) {
showUpdateDialog(context);

View File

@@ -1431,7 +1431,7 @@ class MapPassengerController extends GetxController {
var res = await CRUD().getTokenParent(
link: AppLink.getTokenParent,
payload: {'phone': '+2' + box.read(BoxName.sosPhonePassenger)});
payload: {'phone': '+2${box.read(BoxName.sosPhonePassenger)}'});
// Check if `res` is already a map
if (res is Map<String, dynamic>) {

View File

@@ -1,9 +1,11 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:SEFER/views/auth/login_page.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:uni_links/uni_links.dart';
import '../../constant/box_name.dart';
import '../../main.dart';
@@ -29,10 +31,52 @@ class SplashScreenController extends GetxController
update();
}
StreamSubscription? _sub;
Future<void> initUniLinks() async {
// Handle initial URI if the app was launched from a link
try {
final initialUri = await getInitialUri();
if (initialUri != null) {
handleLink(initialUri);
}
} on PlatformException {
// Handle exception by warning the user their action did not succeed
print("Failed to get initial uri");
}
// Listen to new links while the app is running
_sub = uriLinkStream.listen((Uri? uri) {
if (uri != null) {
handleLink(uri);
}
}, onError: (Object err) {
print('Error occurred: $err');
});
}
void handleLink(Uri uri) {
if (uri.host == 'sefer.live' && uri.path == '/tripmonitor') {
final rideId = uri.queryParameters['rideId'];
final driverId = uri.queryParameters['driverId'];
if (rideId != null && driverId != null) {
Get.toNamed('/tripmonitor', parameters: {
'rideId': rideId,
'driverId': driverId,
});
} else {
// Handle the case where rideId or driverId is null
print('Invalid parameters in the deep link');
// You might want to show an error message to the user or handle this case differently
}
}
}
@override
void onInit() async {
super.onInit();
checkForUpdate();
initUniLinks();
animationController = AnimationController(
vsync: this,
duration: const Duration(seconds: 4),

View File

@@ -51,11 +51,18 @@ class TripMonitorController extends GetxController {
});
}
init() async {
final arguments = Get.arguments;
driverId = arguments['driverId'];
rideId = arguments['rideId'];
// init() async {
// final arguments = Get.arguments;
// driverId = arguments['driverId'];
// rideId = arguments['rideId'];
// await getLocationParent();
// }
Future<void> init({String? rideId, String? driverId}) async {
this.driverId = driverId!;
this.rideId = rideId!;
await getLocationParent();
update();
}
void addCustomCarIcon() {

View File

@@ -58,8 +58,7 @@ class MyTranslation extends Translations {
"You can only use one device at a time. This device will now be set as your active device.":
"يمكنك استخدام جهاز واحد في المرة الواحدة. سيتم الآن تعيين هذا الجهاز كجهازك النشط.",
"Click here point": "انقر هنا", // Click here (literal translation)
"Pick or Tap to confirm":
"اختر أو اضغط للتأكيد", // Choose or Tap to confirm
"Are you want to change": "هل تريد التغيير؟",
'by': 'ب',
"Enter your complaint here": "أدخل شكواك هنا",
@@ -259,7 +258,7 @@ iOS [https://getapp.cc/app/6458734951]
"Enter your phone number": "أدخل رقم هاتفك",
"Please enter your phone number.": "يرجى إدخال رقم هاتفك.",
"Please enter Your Password.": "يرجى إدخال كلمة المرور.",
"Submit": "إرسال",
"if you dont have account": "إذا لم يكن لديك حساب",
"Register": "تسجيل",
"Accept Ride's Terms & Review Privacy Notice":
@@ -321,7 +320,7 @@ iOS [https://getapp.cc/app/6458734951]
"Favorite Places": "الأَمَاكِن المُفَضَّلَة",
"From : Current Location": "مِنْ: المَوْقِع الحَالِي",
"Where to": "إِلَى أَيْن",
"Notifications": "الإشْعَارَات",
// "Notifications": "الإشْعَارَات",
"Profile": "الملف الشَّخْصِي",
"Home": "الصَّفْحَة الرَّئِيسِيَّة",
"My Cared": "المُهْتَمَّ بِهِ",
@@ -401,12 +400,12 @@ iOS [https://getapp.cc/app/6458734951]
"Delete My Account": "حَذْف حِسَابِي",
"Edit Profile": "تَعْدِيل الْمِلَف الشَّخْصِي",
"Name": "الاسْم",
"Gender": "الْجِنْس",
// "Gender": "الْجِنْس",
"Update Gender": "تَحْدِيث الْجِنْس",
"Education": "التَّعْلِيم",
"Update Education": "تَحْدِيث التَّعْلِيم",
"Employment Type": "نَوْع التَّوْظِيف",
"Marital Status": "الْحَالَة الاجْتِمَاعِيَّة",
// "Marital Status": "الْحَالَة الاجْتِمَاعِيَّة",
"SOS Phone": "هَاتِف الطَّوَارِئ",
"High School Diploma": "شَهَادَة الثَّانَوِيَّة الْعَامَّة",
"Associate Degree": "دَرَجَة الزَّمَالَة",