6/9/1
This commit is contained in:
@@ -53,7 +53,7 @@ android {
|
|||||||
applicationId "com.mobileapp.store.ride"
|
applicationId "com.mobileapp.store.ride"
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
minSdkVersion 22
|
minSdkVersion 23
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 30
|
versionCode 30
|
||||||
versionName '1.5.30'
|
versionName '1.5.30'
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import '../../views/home/map_page_passenger.dart';
|
|||||||
import '../../views/home/map_widget.dart/call_passenger_page.dart';
|
import '../../views/home/map_widget.dart/call_passenger_page.dart';
|
||||||
import '../../views/home/profile/promos_passenger_page.dart';
|
import '../../views/home/profile/promos_passenger_page.dart';
|
||||||
import '../auth/google_sign.dart';
|
import '../auth/google_sign.dart';
|
||||||
|
import '../functions/audio_record1.dart';
|
||||||
import '../home/map_passenger_controller.dart';
|
import '../home/map_passenger_controller.dart';
|
||||||
import 'local_notification.dart';
|
import 'local_notification.dart';
|
||||||
|
|
||||||
@@ -128,8 +129,8 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
var passengerList = message.data['passengerList'];
|
var passengerList = message.data['passengerList'];
|
||||||
|
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
driverID = myList[2].toString();
|
driverID = myList[0].toString();
|
||||||
|
Get.find<MapPassengerController>().driverToken = myList[2].toString();
|
||||||
NotificationController().showNotification(
|
NotificationController().showNotification(
|
||||||
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order1');
|
'Apply Order'.tr, 'Driver Applied the Ride for You'.tr, 'order1');
|
||||||
// driverAppliedTripSnakBar();
|
// driverAppliedTripSnakBar();
|
||||||
@@ -180,6 +181,10 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
'Driver Finish Trip'.tr,
|
'Driver Finish Trip'.tr,
|
||||||
'you will pay to Driver'.tr + ' ${driverList[3].toString()} \$'.tr,
|
'you will pay to Driver'.tr + ' ${driverList[3].toString()} \$'.tr,
|
||||||
'tone1');
|
'tone1');
|
||||||
|
Get.find<AudioRecorderController>().stopRecording();
|
||||||
|
if (double.parse(box.read(BoxName.passengerWalletTotal)) < 0) {
|
||||||
|
box.write(BoxName.passengerWalletTotal, 0);
|
||||||
|
}
|
||||||
Get.find<MapPassengerController>().tripFinishedFromDriver();
|
Get.find<MapPassengerController>().tripFinishedFromDriver();
|
||||||
// if (Get.find<PaymentController>().isCashChecked == false &&
|
// if (Get.find<PaymentController>().isCashChecked == false &&
|
||||||
// Get.find<PaymentController>().isWalletChecked == true) {
|
// Get.find<PaymentController>().isWalletChecked == true) {
|
||||||
@@ -263,16 +268,19 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
Get.find<MapPassengerController>().restCounter();
|
Get.find<MapPassengerController>().restCounter();
|
||||||
Get.offAll(const MapPagePassenger());
|
Get.offAll(const MapPagePassenger());
|
||||||
} else if (message.notification!.title! == 'Order Applied') {
|
}
|
||||||
Get.snackbar(
|
// else if (message.notification!.title! == 'Order Applied') {
|
||||||
"The order has been accepted by another driver."
|
// Get.snackbar(
|
||||||
.tr, // Corrected grammar
|
// "The order has been accepted by another driver."
|
||||||
"Be more mindful next time to avoid dropping orders."
|
// .tr, // Corrected grammar
|
||||||
.tr, // Improved sentence structure
|
// "Be more mindful next time to avoid dropping orders."
|
||||||
backgroundColor: AppColor.yellowColor,
|
// .tr, // Improved sentence structure
|
||||||
snackPosition: SnackPosition.BOTTOM,
|
// backgroundColor: AppColor.yellowColor,
|
||||||
);
|
// snackPosition: SnackPosition.BOTTOM,
|
||||||
} else if (message.notification!.title! == 'Order Applied') {
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
else if (message.notification!.title! == 'Order Applied') {
|
||||||
NotificationController().showNotification(
|
NotificationController().showNotification(
|
||||||
'The order Accepted by another Driver'.tr,
|
'The order Accepted by another Driver'.tr,
|
||||||
'We regret to inform you that another driver has accepted this order.'
|
'We regret to inform you that another driver has accepted this order.'
|
||||||
@@ -321,6 +329,8 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
.startTimerDriverWaitPassenger5Minute();
|
.startTimerDriverWaitPassenger5Minute();
|
||||||
|
|
||||||
Get.back();
|
Get.back();
|
||||||
|
Get.find<MapPassengerController>().remainingTime = 0;
|
||||||
|
Get.find<MapPassengerController>().update();
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ class AudioRecorderController extends GetxController {
|
|||||||
final directory = await getApplicationDocumentsDirectory();
|
final directory = await getApplicationDocumentsDirectory();
|
||||||
// Generate a unique file name using the current timestamp
|
// Generate a unique file name using the current timestamp
|
||||||
String fileName =
|
String fileName =
|
||||||
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find<MapPassengerController>().rideId}.aac';
|
// '${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}_${Get.find<MapPassengerController>().rideId}.m4a';
|
||||||
|
'${DateTime.now().year}-${DateTime.now().month}-${DateTime.now().day}.m4a';
|
||||||
filePath = '${directory.path}/$fileName';
|
filePath = '${directory.path}/$fileName';
|
||||||
|
|
||||||
// Define the configuration for the recording
|
// Define the configuration for the recording
|
||||||
|
|||||||
@@ -13,23 +13,21 @@ void launchCommunication(
|
|||||||
String method, String contactInfo, String message) async {
|
String method, String contactInfo, String message) async {
|
||||||
String url;
|
String url;
|
||||||
|
|
||||||
// Encode the message
|
|
||||||
String encodedMessage = Uri.encodeComponent(message);
|
|
||||||
|
|
||||||
if (Platform.isIOS) {
|
if (Platform.isIOS) {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case 'phone':
|
case 'phone':
|
||||||
url = 'tel:$contactInfo';
|
url = 'tel:$contactInfo';
|
||||||
break;
|
break;
|
||||||
case 'sms':
|
case 'sms':
|
||||||
url = 'sms:$contactInfo&body=$encodedMessage';
|
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
case 'whatsapp':
|
case 'whatsapp':
|
||||||
url =
|
url =
|
||||||
'https://api.whatsapp.com/send?phone=$contactInfo&text=$encodedMessage';
|
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
case 'email':
|
case 'email':
|
||||||
url = 'mailto:$contactInfo?subject=Subject&body=$encodedMessage';
|
url =
|
||||||
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print('Method not supported on iOS');
|
print('Method not supported on iOS');
|
||||||
@@ -41,13 +39,25 @@ void launchCommunication(
|
|||||||
url = 'tel:$contactInfo';
|
url = 'tel:$contactInfo';
|
||||||
break;
|
break;
|
||||||
case 'sms':
|
case 'sms':
|
||||||
url = 'sms:$contactInfo?body=$encodedMessage';
|
url = 'sms:$contactInfo?body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
case 'whatsapp':
|
case 'whatsapp':
|
||||||
url = 'whatsapp://send?phone=$contactInfo&text=$encodedMessage';
|
// Check if WhatsApp is installed
|
||||||
|
final bool whatsappInstalled =
|
||||||
|
await canLaunchUrl(Uri.parse('whatsapp://'));
|
||||||
|
if (whatsappInstalled) {
|
||||||
|
url =
|
||||||
|
'whatsapp://send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
|
} else {
|
||||||
|
print('WhatsApp is not installed on this device.');
|
||||||
|
// Provide an alternative action, such as opening the WhatsApp Web API
|
||||||
|
url =
|
||||||
|
'https://api.whatsapp.com/send?phone=$contactInfo&text=${Uri.encodeComponent(message)}';
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'email':
|
case 'email':
|
||||||
url = 'mailto:$contactInfo?subject=Subject&body=$encodedMessage';
|
url =
|
||||||
|
'mailto:$contactInfo?subject=Subject&body=${Uri.encodeComponent(message)}';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print('Method not supported on Android');
|
print('Method not supported on Android');
|
||||||
@@ -58,7 +68,7 @@ void launchCommunication(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
print('Launching URL: $url'); // Add this line for debugging
|
print('Launching URL: $url');
|
||||||
|
|
||||||
if (await canLaunchUrl(Uri.parse(url))) {
|
if (await canLaunchUrl(Uri.parse(url))) {
|
||||||
await launchUrl(Uri.parse(url));
|
await launchUrl(Uri.parse(url));
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'dart:math' show cos;
|
|||||||
import 'dart:math' as math;
|
import 'dart:math' as math;
|
||||||
|
|
||||||
import 'package:SEFER/controller/functions/tts.dart';
|
import 'package:SEFER/controller/functions/tts.dart';
|
||||||
|
import 'package:SEFER/views/home/map_page_passenger.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:geolocator/geolocator.dart';
|
import 'package:geolocator/geolocator.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
@@ -25,6 +26,7 @@ import '../../models/model/locations.dart';
|
|||||||
import '../../views/home/map_widget.dart/car_details_widget_to_go.dart';
|
import '../../views/home/map_widget.dart/car_details_widget_to_go.dart';
|
||||||
import '../../views/widgets/elevated_btn.dart';
|
import '../../views/widgets/elevated_btn.dart';
|
||||||
import '../firebase/firbase_messge.dart';
|
import '../firebase/firbase_messge.dart';
|
||||||
|
import '../functions/audio_record1.dart';
|
||||||
import '../functions/crud.dart';
|
import '../functions/crud.dart';
|
||||||
import '../functions/launch.dart';
|
import '../functions/launch.dart';
|
||||||
import '../functions/secure_storage.dart';
|
import '../functions/secure_storage.dart';
|
||||||
@@ -880,6 +882,8 @@ class MapPassengerController extends GetxController {
|
|||||||
late String make = '';
|
late String make = '';
|
||||||
late String licensePlate = '';
|
late String licensePlate = '';
|
||||||
confirmRideForFirstDriver() async {
|
confirmRideForFirstDriver() async {
|
||||||
|
print('confirmRideForFirstDriver');
|
||||||
|
print('statusRide $statusRide');
|
||||||
await getCarsLocationByPassengerAndReloadMarker();
|
await getCarsLocationByPassengerAndReloadMarker();
|
||||||
await getNearestDriverByPassengerLocationAPIGOOGLE();
|
await getNearestDriverByPassengerLocationAPIGOOGLE();
|
||||||
|
|
||||||
@@ -1066,7 +1070,7 @@ class MapPassengerController extends GetxController {
|
|||||||
];
|
];
|
||||||
print('driversToken');
|
print('driversToken');
|
||||||
print(driversToken);
|
print(driversToken);
|
||||||
for (var i = 0; i < driversToken.length; i++) {
|
for (var i = 1; i < driversToken.length; i++) {
|
||||||
FirebaseMessagesController().sendNotificationToDriverMapPolyline(
|
FirebaseMessagesController().sendNotificationToDriverMapPolyline(
|
||||||
'OrderSpeed',
|
'OrderSpeed',
|
||||||
rideId.toString(),
|
rideId.toString(),
|
||||||
@@ -1450,26 +1454,27 @@ class MapPassengerController extends GetxController {
|
|||||||
FirebaseMessagesController().sendNotificationToDriverMAP(
|
FirebaseMessagesController().sendNotificationToDriverMAP(
|
||||||
'Cancel Trip', 'Trip Cancelled'.tr, driverToken, []);
|
'Cancel Trip', 'Trip Cancelled'.tr, driverToken, []);
|
||||||
}
|
}
|
||||||
rideConfirm = false;
|
// rideConfirm = false;
|
||||||
shouldFetch = false;
|
// shouldFetch = false;
|
||||||
isCashConfirmPageShown = false;
|
// isCashConfirmPageShown = false;
|
||||||
isSearchingWindow = false;
|
// isSearchingWindow = false;
|
||||||
statusRide = 'Cancel';
|
// statusRide = 'Cancel';
|
||||||
isPassengerChosen = false;
|
// isPassengerChosen = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
// isCashSelectedBeforeConfirmRide = false;
|
||||||
isPickerShown = false;
|
// isPickerShown = false;
|
||||||
isMarkersShown = false;
|
// isMarkersShown = false;
|
||||||
haveSteps = false;
|
// haveSteps = false;
|
||||||
isMarkersShown = false;
|
// isMarkersShown = false;
|
||||||
driverToken = '';
|
// driverToken = '';
|
||||||
driverId = '';
|
// driverId = '';
|
||||||
driverPhone = '';
|
// driverPhone = '';
|
||||||
driverName = '';
|
// driverName = '';
|
||||||
// totalStepDurations = 0;
|
// // totalStepDurations = 0;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
// timeToPassengerFromDriverAfterApplied = 0;
|
||||||
remainingTime = 0;
|
// remainingTime = 0;
|
||||||
isWayPointStopsSheetUtilGetMap = false;
|
// isWayPointStopsSheetUtilGetMap = false;
|
||||||
update();
|
// update();
|
||||||
|
Get.offAll(const MapPagePassenger());
|
||||||
} else {
|
} else {
|
||||||
clearPlacesDestination();
|
clearPlacesDestination();
|
||||||
clearPolyline();
|
clearPolyline();
|
||||||
@@ -1479,28 +1484,28 @@ class MapPassengerController extends GetxController {
|
|||||||
"order_id": rideId.toString(), // Convert to String
|
"order_id": rideId.toString(), // Convert to String
|
||||||
"status": 'Cancel'
|
"status": 'Cancel'
|
||||||
});
|
});
|
||||||
|
Get.offAll(const MapPagePassenger());
|
||||||
isPickerShown = false;
|
// isPickerShown = false;
|
||||||
isWayPointStopsSheetUtilGetMap = false;
|
// isWayPointStopsSheetUtilGetMap = false;
|
||||||
rideConfirm = false;
|
// rideConfirm = false;
|
||||||
shouldFetch = false;
|
// shouldFetch = false;
|
||||||
driverToken = '';
|
// driverToken = '';
|
||||||
driverId = '';
|
// driverId = '';
|
||||||
driverPhone = '';
|
// driverPhone = '';
|
||||||
driverName = '';
|
// driverName = '';
|
||||||
isCashConfirmPageShown = false;
|
// isCashConfirmPageShown = false;
|
||||||
isSearchingWindow = false;
|
// isSearchingWindow = false;
|
||||||
isPassengerChosen = false;
|
// isPassengerChosen = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
// isCashSelectedBeforeConfirmRide = false;
|
||||||
statusRide = 'Cancel';
|
// statusRide = 'Cancel';
|
||||||
haveSteps = false;
|
// haveSteps = false;
|
||||||
isMarkersShown = false;
|
// isMarkersShown = false;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
// timeToPassengerFromDriverAfterApplied = 0;
|
||||||
changeCancelRidePageShow();
|
// changeCancelRidePageShow();
|
||||||
clearPolyline();
|
// clearPolyline();
|
||||||
remainingTime = 0;
|
// remainingTime = 0;
|
||||||
durationTimer = 0;
|
// durationTimer = 0;
|
||||||
update();
|
// update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2623,7 +2628,7 @@ class MapPassengerController extends GetxController {
|
|||||||
if (jsonDecode(res)['message']['rating'] == null) {
|
if (jsonDecode(res)['message']['rating'] == null) {
|
||||||
passengerRate = 5;
|
passengerRate = 5;
|
||||||
} else {
|
} else {
|
||||||
passengerRate = jsonDecode(res)['message']['rating'];
|
passengerRate = jsonDecode(res)['message']['rating'].toDouble();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
passengerRate = 5;
|
passengerRate = 5;
|
||||||
@@ -2649,6 +2654,7 @@ class MapPassengerController extends GetxController {
|
|||||||
Get.put(TextToSpeechController());
|
Get.put(TextToSpeechController());
|
||||||
box.write(BoxName.carType, 'yet');
|
box.write(BoxName.carType, 'yet');
|
||||||
box.write(BoxName.tipPercentage, '0');
|
box.write(BoxName.tipPercentage, '0');
|
||||||
|
Get.put(AudioRecorderController());
|
||||||
// await getNearestDriverByPassengerLocation();
|
// await getNearestDriverByPassengerLocation();
|
||||||
|
|
||||||
initilizeGetStorage();
|
initilizeGetStorage();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||||
import 'package:path/path.dart' as path;
|
import 'package:path/path.dart' as path;
|
||||||
|
import '../../../constant/box_name.dart';
|
||||||
import '../../../constant/colors.dart';
|
import '../../../constant/colors.dart';
|
||||||
import '../../../constant/links.dart';
|
import '../../../constant/links.dart';
|
||||||
import '../../../controller/functions/audio_record1.dart';
|
import '../../../controller/functions/audio_record1.dart';
|
||||||
@@ -88,6 +89,26 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 5,
|
width: 5,
|
||||||
),
|
),
|
||||||
|
// AnimatedContainer(
|
||||||
|
// duration: const Duration(microseconds: 200),
|
||||||
|
// width: controller.widthMapTypeAndTraffic,
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// color: AppColor.secondaryColor,
|
||||||
|
// border: Border.all(),
|
||||||
|
// borderRadius: BorderRadius.circular(15)),
|
||||||
|
// child: IconButton(
|
||||||
|
// onPressed: () async {
|
||||||
|
// // AudioRecorderController audioController =
|
||||||
|
// // Get.put(AudioRecorderController());
|
||||||
|
// // sql.deleteAllData(TableName.recentLocations);
|
||||||
|
// // await audioController.startRecording();
|
||||||
|
// },
|
||||||
|
// icon: const Icon(
|
||||||
|
// Icons.voice_chat,
|
||||||
|
// size: 29,
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
AnimatedContainer(
|
AnimatedContainer(
|
||||||
duration: const Duration(microseconds: 200),
|
duration: const Duration(microseconds: 200),
|
||||||
width: controller.widthMapTypeAndTraffic,
|
width: controller.widthMapTypeAndTraffic,
|
||||||
@@ -97,10 +118,13 @@ GetBuilder<MapPassengerController> leftMainMenuIcons() {
|
|||||||
borderRadius: BorderRadius.circular(15)),
|
borderRadius: BorderRadius.circular(15)),
|
||||||
child: IconButton(
|
child: IconButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
sql.deleteAllData(TableName.recentLocations);
|
var phone = box.read(BoxName.countryCode) == 'Egypt'
|
||||||
|
? '+2${box.read(BoxName.sosPhonePassenger)}'
|
||||||
|
: '+962${box.read(BoxName.sosPhonePassenger)}';
|
||||||
|
controller.sendWhatsapp(phone);
|
||||||
},
|
},
|
||||||
icon: const Icon(
|
icon: const Icon(
|
||||||
Icons.voice_chat,
|
Icons.chat,
|
||||||
size: 29,
|
size: 29,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
Reference in New Issue
Block a user