7/7/1
This commit is contained in:
@@ -74,7 +74,7 @@ class LoginController extends GetxController {
|
||||
var jsonDecoeded = jsonDecode(res);
|
||||
if (jsonDecoeded.isNotEmpty) {
|
||||
if (jsonDecoeded['status'] == 'success' &&
|
||||
jsonDecoeded['data'][0]['verified'] == 1) {
|
||||
jsonDecoeded['data'][0]['verified'].toString() == '1') {
|
||||
//
|
||||
box.write(BoxName.isVerified, '1');
|
||||
box.write(BoxName.email, jsonDecoeded['data'][0]['email']);
|
||||
|
||||
@@ -93,15 +93,28 @@ class RegisterController extends GetxController {
|
||||
.post(link: AppLink.checkPhoneNumberISVerfiedPassenger, payload: {
|
||||
'phone_number': '+2${phoneController.text}',
|
||||
});
|
||||
// if (responseCheker != 'failure') {
|
||||
var d = jsonDecode(responseCheker);
|
||||
if (d['message'][0]['verified'].toString() == '1') {
|
||||
Get.snackbar('Phone number is verified before'.tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
box.write(BoxName.isVerified, '1');
|
||||
box.write(BoxName.phone, '+2${phoneController.text}');
|
||||
Get.offAll(const MapPagePassenger());
|
||||
// }
|
||||
if (responseCheker != 'failure') {
|
||||
var d = jsonDecode(responseCheker);
|
||||
if (d['message'][0]['verified'].toString() == '1') {
|
||||
Get.snackbar('Phone number is verified before'.tr, '',
|
||||
backgroundColor: AppColor.greenColor);
|
||||
box.write(BoxName.isVerified, '1');
|
||||
box.write(BoxName.phone, '+2${phoneController.text}');
|
||||
Get.offAll(const MapPagePassenger());
|
||||
} else {
|
||||
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
||||
'phone_number': '+2${phoneController.text}',
|
||||
'token': randomNumber.toString(),
|
||||
});
|
||||
|
||||
await smsEgyptController.sendSmsEgypt(
|
||||
phoneController.text.toString(), randomNumber.toString());
|
||||
isSent = true;
|
||||
remainingTime = 300; // Reset to 5 minutes
|
||||
startTimer();
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
} else {
|
||||
await CRUD().post(link: AppLink.sendVerifyOtpMessage, payload: {
|
||||
'phone_number': '+2${phoneController.text}',
|
||||
@@ -115,6 +128,8 @@ class RegisterController extends GetxController {
|
||||
startTimer();
|
||||
isLoading = false;
|
||||
update();
|
||||
|
||||
// Get.snackbar(responseCheker, 'message');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -894,8 +894,9 @@ class MapPassengerController extends GetxController {
|
||||
try {
|
||||
Uri uri = Uri.parse(link);
|
||||
|
||||
if (uri.host == 'maps.google.com') {
|
||||
if (uri.host == 'maps.google.com' || uri.host == 'www.google.com') {
|
||||
String? query = uri.queryParameters['q'];
|
||||
query ??= uri.queryParameters['ll'];
|
||||
|
||||
if (query != null) {
|
||||
List<String> coordinates = query.split(',');
|
||||
@@ -910,6 +911,9 @@ class MapPassengerController extends GetxController {
|
||||
};
|
||||
}
|
||||
}
|
||||
} else if (uri.host == 'goo.gl') {
|
||||
// Shortened URLs might need to be expanded first
|
||||
// Implement additional logic to expand the URL here if necessary
|
||||
}
|
||||
} catch (e) {
|
||||
print('Error parsing WhatsApp location link: $e');
|
||||
@@ -1164,7 +1168,7 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
void delayAndFetchRideStatus(String rideId) {
|
||||
Timer(const Duration(milliseconds: 200), () async {
|
||||
Timer(const Duration(seconds: 1), () async {
|
||||
if (shouldFetch) {
|
||||
if (remainingTimeToPassengerFromDriverAfterApplied > 0) {
|
||||
var res = await getRideStatus(rideId);
|
||||
@@ -1197,7 +1201,7 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
|
||||
void delayAndFetchRideStatusForAllDriverAvailable(String rideId) {
|
||||
Timer(const Duration(milliseconds: 200), () async {
|
||||
Timer(const Duration(milliseconds: 1000), () async {
|
||||
if (shouldFetch) {
|
||||
var res = await getRideStatus(rideId);
|
||||
// var decod = jsonDecode(res);
|
||||
@@ -1532,8 +1536,8 @@ class MapPassengerController extends GetxController {
|
||||
await Future.delayed(const Duration(seconds: 4));
|
||||
if (rideTimerBegin == true || statusRide == 'Apply') {
|
||||
await getDriverCarsLocationToPassengerAfterApplied();
|
||||
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
|
||||
}
|
||||
reloadMarkerDriverCarsLocationToPassengerAfterApplied();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2107,6 +2111,7 @@ class MapPassengerController extends GetxController {
|
||||
|
||||
reloadMarkers() async {
|
||||
if (statusRide == 'wait') {
|
||||
clearMarkersExceptStartEnd();
|
||||
await getCarsLocationByPassengerAndReloadMarker();
|
||||
await getNearestDriverByPassengerLocation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user