1/13/1
This commit is contained in:
1
.env
1
.env
@@ -18,3 +18,4 @@ claudeAiAPI=sk-ant-api03-bHIbOKhHWIsTCNmODYGGucds_GPQplU-7_8SJER79K_ANU67ijWIZZi
|
|||||||
payPalClientId=AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x
|
payPalClientId=AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x
|
||||||
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
||||||
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,8 @@ android {
|
|||||||
minSdkVersion 23
|
minSdkVersion 23
|
||||||
targetSdkVersion flutter.targetSdkVersion
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
versionCode 15
|
versionCode 15
|
||||||
versionName '1.3.8'
|
versionName '1.3.9'
|
||||||
|
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||||
}
|
}
|
||||||
|
|
||||||
signingConfigs {
|
signingConfigs {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
<category android:name="android.intent.category.LAUNCHER"/>
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0"/>
|
<meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/api_key"/>
|
||||||
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id"/>
|
<meta-data android:name="com.google.firebase.messaging.default_notification_channel_id" android:value="@string/default_notification_channel_id"/>
|
||||||
<meta-data android:name="com.android.application.versionCode" android:value="1"/>
|
<meta-data android:name="com.android.application.versionCode" android:value="1"/>
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">My App</string>
|
<string name="app_name">My App</string>
|
||||||
<string name="default_notification_channel_id">ride_channel</string>
|
<string name="default_notification_channel_id">ride_channel</string>
|
||||||
|
<string name="api_key">AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0</string>
|
||||||
</resources>
|
</resources>
|
||||||
@@ -75,6 +75,7 @@ class AppLink {
|
|||||||
//-----------------Api Key------------------
|
//-----------------Api Key------------------
|
||||||
static String addApiKey = "$ride/apiKey/add.php";
|
static String addApiKey = "$ride/apiKey/add.php";
|
||||||
static String getApiKey = "$ride/apiKey/get.php";
|
static String getApiKey = "$ride/apiKey/get.php";
|
||||||
|
static String getCnMap = "$server/auth/cnMap.php";
|
||||||
static String updateApiKey = "$ride/apiKey/update.php";
|
static String updateApiKey = "$ride/apiKey/update.php";
|
||||||
static String deleteApiKey = "$ride/apiKey/delete.php";
|
static String deleteApiKey = "$ride/apiKey/delete.php";
|
||||||
|
|
||||||
|
|||||||
@@ -96,105 +96,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
|
|
||||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||||
if (message.data.isNotEmpty) {
|
if (message.data.isNotEmpty) {
|
||||||
if (message.notification!.title!.contains('Order')) {
|
firebasetitles(message);
|
||||||
var myListString = message.data['DriverList'];
|
|
||||||
print(myListString);
|
|
||||||
print('9999999999999myListString999999999999999');
|
|
||||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
|
||||||
driverToken = myList[14].toString();
|
|
||||||
update();
|
|
||||||
print('driverToken==============$driverToken');
|
|
||||||
Get.to(() => OrderRequestPage(), arguments: {
|
|
||||||
'myListString': myListString,
|
|
||||||
'DriverList': myList,
|
|
||||||
'body': message.notification!.body
|
|
||||||
});
|
|
||||||
} else if (message.notification!.title!.contains('Apply Ride')) {
|
|
||||||
var passengerList = message.data['passengerList'];
|
|
||||||
print(passengerList);
|
|
||||||
print('9999999999999my Apply Ride 999999999999999');
|
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
|
||||||
driverID = myList[2].toString();
|
|
||||||
|
|
||||||
Get.snackbar(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
'message',
|
|
||||||
colorText: AppColor.greenColor,
|
|
||||||
duration: const Duration(seconds: 11),
|
|
||||||
instantInit: true,
|
|
||||||
snackPosition: SnackPosition.TOP,
|
|
||||||
titleText: Text(
|
|
||||||
'Applied'.tr,
|
|
||||||
style: const TextStyle(color: AppColor.redColor),
|
|
||||||
),
|
|
||||||
messageText: Text(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
icon: const Icon(Icons.approval),
|
|
||||||
shouldIconPulse: true,
|
|
||||||
maxWidth: double.infinity,
|
|
||||||
margin: const EdgeInsets.all(16),
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
borderRadius: 8,
|
|
||||||
borderColor: AppColor.primaryColor,
|
|
||||||
borderWidth: 2,
|
|
||||||
backgroundColor: AppColor.secondaryColor,
|
|
||||||
leftBarIndicatorColor: AppColor.greenColor,
|
|
||||||
boxShadows: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.25),
|
|
||||||
blurRadius: 4,
|
|
||||||
spreadRadius: 2,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
backgroundGradient: const LinearGradient(
|
|
||||||
colors: [AppColor.greenColor, AppColor.accentColor],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
onTap: (GetSnackBar snackBar) {
|
|
||||||
// Do something when the snackbar is tapped.
|
|
||||||
// MapController().rideConfirm = false;
|
|
||||||
// update();
|
|
||||||
},
|
|
||||||
isDismissible: true,
|
|
||||||
showProgressIndicator: false,
|
|
||||||
dismissDirection: DismissDirection.up,
|
|
||||||
progressIndicatorController: null,
|
|
||||||
progressIndicatorBackgroundColor: Colors.transparent,
|
|
||||||
progressIndicatorValueColor: null,
|
|
||||||
snackStyle: SnackStyle.GROUNDED,
|
|
||||||
forwardAnimationCurve: Curves.easeInToLinear,
|
|
||||||
reverseAnimationCurve: Curves.easeInOut,
|
|
||||||
animationDuration: const Duration(milliseconds: 4000),
|
|
||||||
barBlur: 8,
|
|
||||||
overlayBlur: 0,
|
|
||||||
snackbarStatus: null,
|
|
||||||
overlayColor: AppColor.primaryColor.withOpacity(0.5),
|
|
||||||
userInputForm: null,
|
|
||||||
);
|
|
||||||
} else if (message.notification!.title!.contains('Promo')) {
|
|
||||||
Get.to(const PromosPassengerPage());
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('DriverIsGoingToPassenger')) {
|
|
||||||
Get.snackbar('Driver is Going To Passenger', '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
} else if (message.notification!.title!.contains('RideIsBegin')) {
|
|
||||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
|
||||||
Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.driverArrivePassenger();
|
|
||||||
update();
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('Captain Finish Trip')) {
|
|
||||||
// MapPassengerController mapController =
|
|
||||||
// Get.find<MapPassengerController>();
|
|
||||||
Get.snackbar('Ride Finished'.tr, '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.isRideFinished = true;//todo fix that for dfinish ride in passenger app
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// If the app is in the background or terminated, show a system tray message
|
// If the app is in the background or terminated, show a system tray message
|
||||||
RemoteNotification? notification = message.notification;
|
RemoteNotification? notification = message.notification;
|
||||||
@@ -203,106 +105,7 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
if (notification != null && android != null) {
|
if (notification != null && android != null) {
|
||||||
// print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
// print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
||||||
if (message.data.isNotEmpty) {
|
if (message.data.isNotEmpty) {
|
||||||
if (message.notification!.title!.contains('Order')) {
|
firebasetitles(message);
|
||||||
var myListString = message.data['DriverList'];
|
|
||||||
// print(myListString);
|
|
||||||
// print('9999999999999myListString999999999999999');
|
|
||||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
|
||||||
driverToken = myList[14].toString();
|
|
||||||
update();
|
|
||||||
// print('driverToken==============$driverToken');
|
|
||||||
Get.to(() => OrderRequestPage(), arguments: {
|
|
||||||
'myListString': myListString,
|
|
||||||
'DriverList': myList,
|
|
||||||
'body': message.notification!.body
|
|
||||||
});
|
|
||||||
} else if (message.notification!.title!.contains('Apply Ride')) {
|
|
||||||
var passengerList = message.data['passengerList'];
|
|
||||||
// print(passengerList);
|
|
||||||
// print('9999999999999my Apply Ride 999999999999999');
|
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
|
||||||
driverID = myList[2].toString();
|
|
||||||
|
|
||||||
Get.snackbar(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
'message',
|
|
||||||
colorText: AppColor.greenColor,
|
|
||||||
duration: const Duration(seconds: 11),
|
|
||||||
instantInit: true,
|
|
||||||
snackPosition: SnackPosition.TOP,
|
|
||||||
titleText: Text(
|
|
||||||
'Applied'.tr,
|
|
||||||
style: const TextStyle(color: AppColor.redColor),
|
|
||||||
),
|
|
||||||
messageText: Text(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
icon: const Icon(Icons.approval),
|
|
||||||
shouldIconPulse: true,
|
|
||||||
maxWidth: double.infinity,
|
|
||||||
margin: const EdgeInsets.all(16),
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
borderRadius: 8,
|
|
||||||
borderColor: AppColor.primaryColor,
|
|
||||||
borderWidth: 2,
|
|
||||||
backgroundColor: AppColor.secondaryColor,
|
|
||||||
leftBarIndicatorColor: AppColor.greenColor,
|
|
||||||
boxShadows: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.25),
|
|
||||||
blurRadius: 4,
|
|
||||||
spreadRadius: 2,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
backgroundGradient: const LinearGradient(
|
|
||||||
colors: [AppColor.greenColor, AppColor.accentColor],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
onTap: (GetSnackBar snackBar) {
|
|
||||||
// Do something when the snackbar is tapped.
|
|
||||||
// MapController().rideConfirm = false;
|
|
||||||
// update();
|
|
||||||
},
|
|
||||||
isDismissible: true,
|
|
||||||
showProgressIndicator: false,
|
|
||||||
dismissDirection: DismissDirection.up,
|
|
||||||
progressIndicatorController: null,
|
|
||||||
progressIndicatorBackgroundColor: Colors.transparent,
|
|
||||||
progressIndicatorValueColor: null,
|
|
||||||
snackStyle: SnackStyle.GROUNDED,
|
|
||||||
forwardAnimationCurve: Curves.easeInToLinear,
|
|
||||||
reverseAnimationCurve: Curves.easeInOut,
|
|
||||||
animationDuration: const Duration(milliseconds: 4000),
|
|
||||||
barBlur: 8,
|
|
||||||
overlayBlur: 0,
|
|
||||||
snackbarStatus: null,
|
|
||||||
overlayColor: AppColor.primaryColor.withOpacity(0.5),
|
|
||||||
userInputForm: null,
|
|
||||||
);
|
|
||||||
} else if (message.notification!.title!.contains('Promo')) {
|
|
||||||
Get.to(const PromosPassengerPage());
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('DriverIsGoingToPassenger')) {
|
|
||||||
Get.snackbar('Driver is Going To Passenger', '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
} else if (message.notification!.title!.contains('RideIsBegin')) {
|
|
||||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
|
||||||
Get.snackbar('RideIsBegin', '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.driverArrivePassenger();
|
|
||||||
update();
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('Captain Finish Trip')) {
|
|
||||||
// MapPassengerController mapController =
|
|
||||||
// Get.find<MapPassengerController>();
|
|
||||||
Get.snackbar('Ride Finished'.tr, '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.isRideFinished = true;//todo fix that for dfinish ride in passenger app
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -311,110 +114,71 @@ class FirebaseMessagesController extends GetxController {
|
|||||||
// print(
|
// print(
|
||||||
// 'onMessageOpenedApp: ${message.notification!.title} ${message.notification!.body}');
|
// 'onMessageOpenedApp: ${message.notification!.title} ${message.notification!.body}');
|
||||||
RemoteNotification? notification = message.notification;
|
RemoteNotification? notification = message.notification;
|
||||||
if (message.data.isNotEmpty) {
|
firebasetitles(message);
|
||||||
if (notification!.title!.contains('Order')) {
|
|
||||||
var myListString = message.data['DriverList'];
|
|
||||||
// print(myListString);
|
|
||||||
// print('9999999999999myListString999999999999999');
|
|
||||||
var myList = jsonDecode(myListString) as List<dynamic>;
|
|
||||||
driverToken = myList[14].toString();
|
|
||||||
update();
|
|
||||||
// print('driverToken==============$driverToken');
|
|
||||||
Get.to(() => OrderRequestPage(), arguments: {
|
|
||||||
'myListString': myListString,
|
|
||||||
'DriverList': myList,
|
|
||||||
'body': message.notification!.body
|
|
||||||
});
|
|
||||||
} else if (message.notification!.title!.contains('Apply Ride')) {
|
|
||||||
var passengerList = message.data['passengerList'];
|
|
||||||
// print(passengerList);
|
|
||||||
// print('9999999999999my Apply Ride 999999999999999');
|
|
||||||
var myList = jsonDecode(passengerList) as List<dynamic>;
|
|
||||||
driverID = myList[2].toString();
|
|
||||||
|
|
||||||
Get.snackbar(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
'message',
|
|
||||||
colorText: AppColor.greenColor,
|
|
||||||
duration: const Duration(seconds: 11),
|
|
||||||
instantInit: true,
|
|
||||||
snackPosition: SnackPosition.TOP,
|
|
||||||
titleText: Text(
|
|
||||||
'Applied'.tr,
|
|
||||||
style: const TextStyle(color: AppColor.redColor),
|
|
||||||
),
|
|
||||||
messageText: Text(
|
|
||||||
'Captain Applied the Ride for You'.tr,
|
|
||||||
style: AppStyle.title,
|
|
||||||
),
|
|
||||||
icon: const Icon(Icons.approval),
|
|
||||||
shouldIconPulse: true,
|
|
||||||
maxWidth: double.infinity,
|
|
||||||
margin: const EdgeInsets.all(16),
|
|
||||||
padding: const EdgeInsets.all(16),
|
|
||||||
borderRadius: 8,
|
|
||||||
borderColor: AppColor.primaryColor,
|
|
||||||
borderWidth: 2,
|
|
||||||
backgroundColor: AppColor.secondaryColor,
|
|
||||||
leftBarIndicatorColor: AppColor.greenColor,
|
|
||||||
boxShadows: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Colors.black.withOpacity(0.25),
|
|
||||||
blurRadius: 4,
|
|
||||||
spreadRadius: 2,
|
|
||||||
offset: const Offset(0, 4),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
backgroundGradient: const LinearGradient(
|
|
||||||
colors: [AppColor.greenColor, AppColor.accentColor],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
onTap: (GetSnackBar snackBar) {
|
|
||||||
// Do something when the snackbar is tapped.
|
|
||||||
// MapController().rideConfirm = false;
|
|
||||||
// update();
|
|
||||||
},
|
|
||||||
isDismissible: true,
|
|
||||||
showProgressIndicator: false,
|
|
||||||
dismissDirection: DismissDirection.up,
|
|
||||||
progressIndicatorController: null,
|
|
||||||
progressIndicatorBackgroundColor: Colors.transparent,
|
|
||||||
progressIndicatorValueColor: null,
|
|
||||||
snackStyle: SnackStyle.GROUNDED,
|
|
||||||
forwardAnimationCurve: Curves.easeInToLinear,
|
|
||||||
reverseAnimationCurve: Curves.easeInOut,
|
|
||||||
animationDuration: const Duration(milliseconds: 4000),
|
|
||||||
barBlur: 8,
|
|
||||||
overlayBlur: 0,
|
|
||||||
snackbarStatus: null,
|
|
||||||
overlayColor: AppColor.primaryColor.withOpacity(0.5),
|
|
||||||
userInputForm: null,
|
|
||||||
);
|
|
||||||
} else if (message.notification!.title!.contains('Promo')) {
|
|
||||||
Get.to(const PromosPassengerPage());
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('DriverIsGoingToPassenger')) {
|
|
||||||
Get.snackbar('Driver is Going To Passenger', '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
} else if (message.notification!.title!.contains('RideIsBegin')) {
|
|
||||||
// MapPassengerController mapController = Get.put(MapPassengerController());
|
|
||||||
Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.driverArrivePassenger();
|
|
||||||
update();
|
|
||||||
} else if (message.notification!.title!
|
|
||||||
.contains('Captain Finish Trip')) {
|
|
||||||
// MapPassengerController mapController =
|
|
||||||
// Get.find<MapPassengerController>();
|
|
||||||
Get.snackbar('Ride Finished'.tr, '',
|
|
||||||
backgroundColor: AppColor.greenColor);
|
|
||||||
// mapController.isRideFinished = true;//todo fix that for dfinish ride in passenger app
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void firebasetitles(RemoteMessage message) {
|
||||||
|
if (message.notification!.title!.contains('Order')) {
|
||||||
|
var myListString = message.data['DriverList'];
|
||||||
|
print(myListString);
|
||||||
|
print('9999999999999myListString999999999999999');
|
||||||
|
var myList = jsonDecode(myListString) as List<dynamic>;
|
||||||
|
driverToken = myList[14].toString();
|
||||||
|
update();
|
||||||
|
print('driverToken==============$driverToken');
|
||||||
|
Get.to(() => OrderRequestPage(), arguments: {
|
||||||
|
'myListString': myListString,
|
||||||
|
'DriverList': myList,
|
||||||
|
'body': message.notification!.body
|
||||||
|
});
|
||||||
|
} else if (message.notification!.title!.contains('Apply Ride')) {
|
||||||
|
var passengerList = message.data['passengerList'];
|
||||||
|
print(passengerList);
|
||||||
|
print('9999999999999my Apply Ride 999999999999999');
|
||||||
|
var myList = jsonDecode(passengerList) as List<dynamic>;
|
||||||
|
driverID = myList[2].toString();
|
||||||
|
|
||||||
|
Get.snackbar(
|
||||||
|
'Captain Applied the Ride for You'.tr,
|
||||||
|
'message',
|
||||||
|
colorText: AppColor.greenColor,
|
||||||
|
duration: const Duration(seconds: 11),
|
||||||
|
snackPosition: SnackPosition.TOP,
|
||||||
|
titleText: Text(
|
||||||
|
'Applied'.tr,
|
||||||
|
style: const TextStyle(color: AppColor.redColor),
|
||||||
|
),
|
||||||
|
messageText: Text(
|
||||||
|
'Captain Applied the Ride for You'.tr,
|
||||||
|
style: AppStyle.title,
|
||||||
|
),
|
||||||
|
icon: const Icon(Icons.approval),
|
||||||
|
shouldIconPulse: true,
|
||||||
|
margin: const EdgeInsets.all(16),
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
);
|
||||||
|
} else if (message.notification!.title!.contains('Promo')) {
|
||||||
|
Get.to(const PromosPassengerPage());
|
||||||
|
} else if (message.notification!.title!
|
||||||
|
.contains('DriverIsGoingToPassenger')) {
|
||||||
|
Get.snackbar('Driver is Going To Passenger', '',
|
||||||
|
backgroundColor: AppColor.greenColor);
|
||||||
|
} else if (message.notification!.title!.contains('RideIsBegin')) {
|
||||||
|
// MapPassengerController mapController = Get.put(MapPassengerController());
|
||||||
|
Get.snackbar('RideIsBegin', '', backgroundColor: AppColor.greenColor);
|
||||||
|
// mapController.driverArrivePassenger();
|
||||||
|
update();
|
||||||
|
} else if (message.notification!.title!.contains('Captain Finish Trip')) {
|
||||||
|
// MapPassengerController mapController =
|
||||||
|
// Get.find<MapPassengerController>();
|
||||||
|
Get.snackbar('Ride Finished'.tr, '',
|
||||||
|
backgroundColor: AppColor.greenColor);
|
||||||
|
// mapController.isRideFinished = true;//todo fix that for dfinish ride in passenger app
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void sendNotificationAll(String title, body) async {
|
void sendNotificationAll(String title, body) async {
|
||||||
// Get the token you want to subtract.
|
// Get the token you want to subtract.
|
||||||
String token = box.read(BoxName.tokenFCM);
|
String token = box.read(BoxName.tokenFCM);
|
||||||
|
|||||||
@@ -108,6 +108,8 @@ class MapPassengerController extends GetxController {
|
|||||||
bool rideConfirm = false;
|
bool rideConfirm = false;
|
||||||
bool isMainBottomMenuMap = true;
|
bool isMainBottomMenuMap = true;
|
||||||
bool isWayPointSheet = false;
|
bool isWayPointSheet = false;
|
||||||
|
bool isWayPointStopsSheet = false;
|
||||||
|
bool isWayPointStopsSheetUtilGetMap = false;
|
||||||
double heightBottomSheetShown = 0;
|
double heightBottomSheetShown = 0;
|
||||||
double cashConfirmPageShown = 250;
|
double cashConfirmPageShown = 250;
|
||||||
late String driverId;
|
late String driverId;
|
||||||
@@ -125,7 +127,7 @@ class MapPassengerController extends GetxController {
|
|||||||
double progress = 0;
|
double progress = 0;
|
||||||
double progressTimerToPassengerFromDriverAfterApplied = 0;
|
double progressTimerToPassengerFromDriverAfterApplied = 0;
|
||||||
int durationTimer = 25;
|
int durationTimer = 25;
|
||||||
late int durationToRide;
|
int durationToRide = 0;
|
||||||
int remainingTime = 25;
|
int remainingTime = 25;
|
||||||
int remainingTimeToPassengerFromDriverAfterApplied = 60;
|
int remainingTimeToPassengerFromDriverAfterApplied = 60;
|
||||||
int timeToPassengerFromDriverAfterApplied = 0;
|
int timeToPassengerFromDriverAfterApplied = 0;
|
||||||
@@ -804,6 +806,7 @@ class MapPassengerController extends GetxController {
|
|||||||
shouldFetch = false;
|
shouldFetch = false;
|
||||||
isPassengerChosen = false;
|
isPassengerChosen = false;
|
||||||
isCashConfirmPageShown = false;
|
isCashConfirmPageShown = false;
|
||||||
|
totalStepDurations = 0;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
isCashSelectedBeforeConfirmRide = false;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
timeToPassengerFromDriverAfterApplied = 0;
|
||||||
changeCancelRidePageShow();
|
changeCancelRidePageShow();
|
||||||
@@ -826,6 +829,7 @@ class MapPassengerController extends GetxController {
|
|||||||
isPassengerChosen = false;
|
isPassengerChosen = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
isCashSelectedBeforeConfirmRide = false;
|
||||||
isPickerShown = false;
|
isPickerShown = false;
|
||||||
|
totalStepDurations = 0;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
timeToPassengerFromDriverAfterApplied = 0;
|
||||||
update();
|
update();
|
||||||
} else {
|
} else {
|
||||||
@@ -843,6 +847,7 @@ class MapPassengerController extends GetxController {
|
|||||||
isCashConfirmPageShown = false;
|
isCashConfirmPageShown = false;
|
||||||
isCashSelectedBeforeConfirmRide = false;
|
isCashSelectedBeforeConfirmRide = false;
|
||||||
timeToPassengerFromDriverAfterApplied = 0;
|
timeToPassengerFromDriverAfterApplied = 0;
|
||||||
|
totalStepDurations = 0;
|
||||||
changeCancelRidePageShow();
|
changeCancelRidePageShow();
|
||||||
remainingTime = 0;
|
remainingTime = 0;
|
||||||
|
|
||||||
@@ -862,16 +867,28 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void changeMainBottomMenuMap() {
|
getCoordinateFromMapWayPoints(int index) {
|
||||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
placesCoordinate[index] = newStartPointLocation.toString();
|
||||||
mainBottomMenuMapHeight =
|
|
||||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
|
||||||
if (heightMenuBool == true) {
|
|
||||||
getDrawerMenu();
|
|
||||||
}
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeMainBottomMenuMap() {
|
||||||
|
print(isWayPointStopsSheetUtilGetMap);
|
||||||
|
if (isWayPointStopsSheetUtilGetMap == true) {
|
||||||
|
isWayPointSheet = true;
|
||||||
|
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||||
|
update();
|
||||||
|
} else {
|
||||||
|
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||||
|
mainBottomMenuMapHeight =
|
||||||
|
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||||
|
if (heightMenuBool == true) {
|
||||||
|
getDrawerMenu();
|
||||||
|
}
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void changeWayPointSheet() {
|
void changeWayPointSheet() {
|
||||||
isWayPointSheet = !isWayPointSheet;
|
isWayPointSheet = !isWayPointSheet;
|
||||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||||
@@ -881,6 +898,16 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void changeWayPointStopsSheet() {
|
||||||
|
isWayPointStopsSheetUtilGetMap = true;
|
||||||
|
isWayPointStopsSheet = !isWayPointStopsSheet;
|
||||||
|
wayPointSheetHeight = isWayPointStopsSheet == false ? 0 : Get.height * .4;
|
||||||
|
// if (heightMenuBool == true) {
|
||||||
|
// getDrawerMenu();
|
||||||
|
// }
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
changeHeightPlaces() {
|
changeHeightPlaces() {
|
||||||
if (placesDestination.isEmpty) {
|
if (placesDestination.isEmpty) {
|
||||||
height = 0;
|
height = 0;
|
||||||
@@ -986,49 +1013,49 @@ class MapPassengerController extends GetxController {
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future getPlacesListsWayPoint1() async {
|
// Future getPlacesListsWayPoint1() async {
|
||||||
var url =
|
// var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint1Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint1Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
// var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
wayPoint1 = response['results'];
|
// wayPoint1 = response['results'];
|
||||||
print(wayPoint1);
|
// print(wayPoint1);
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future getPlacesListsWayPoint2() async {
|
// Future getPlacesListsWayPoint2() async {
|
||||||
var url =
|
// var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint2Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint2Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
// var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
wayPoint2 = response['results'];
|
// wayPoint2 = response['results'];
|
||||||
print(wayPoint2);
|
// print(wayPoint2);
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future getPlacesListsWayPoint3() async {
|
// Future getPlacesListsWayPoint3() async {
|
||||||
var url =
|
// var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint3Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint3Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
// var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
wayPoint3 = response['results'];
|
// wayPoint3 = response['results'];
|
||||||
print(wayPoint3);
|
// print(wayPoint3);
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
|
|
||||||
Future getPlacesListsWayPoint4() async {
|
// Future getPlacesListsWayPoint4() async {
|
||||||
var url =
|
// var url =
|
||||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint4Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
// '${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint4Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||||
|
|
||||||
var response = await CRUD().getGoogleApi(link: url, payload: {});
|
// var response = await CRUD().getGoogleApi(link: url, payload: {});
|
||||||
|
|
||||||
wayPoint4 = response['results'];
|
// wayPoint4 = response['results'];
|
||||||
print(wayPoint4);
|
// print(wayPoint4);
|
||||||
update();
|
// update();
|
||||||
}
|
// }
|
||||||
|
|
||||||
LatLng fromString(String location) {
|
LatLng fromString(String location) {
|
||||||
List<String> parts = location.split(',');
|
List<String> parts = location.split(',');
|
||||||
@@ -1367,7 +1394,9 @@ class MapPassengerController extends GetxController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int totalStepDurations = 0;
|
||||||
getMapPoints(String origin, destination, int index) async {
|
getMapPoints(String origin, destination, int index) async {
|
||||||
|
isWayPointStopsSheetUtilGetMap = false;
|
||||||
await getCarsLocationByPassenger();
|
await getCarsLocationByPassenger();
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
@@ -1379,7 +1408,8 @@ class MapPassengerController extends GetxController {
|
|||||||
// print(data);
|
// print(data);
|
||||||
isLoading = false;
|
isLoading = false;
|
||||||
update();
|
update();
|
||||||
durationToRide = data[0]['duration']['value'];
|
durationToRide = durationToRide + int.parse(data[0]['duration']['value']);
|
||||||
|
// totalStepDurations = totalStepDurations + durationToRide;
|
||||||
final points =
|
final points =
|
||||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||||
for (int i = 0; i < points.length; i++) {
|
for (int i = 0; i < points.length; i++) {
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
|||||||
await Firebase.initializeApp();
|
await Firebase.initializeApp();
|
||||||
print('===========back===${message.notification?.title}');
|
print('===========back===${message.notification?.title}');
|
||||||
|
|
||||||
if (message.notification!.title == 'Sefer') {}
|
FirebaseMessagesController().firebasetitles(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() async {
|
void main() async {
|
||||||
|
|||||||
@@ -58,11 +58,13 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
|||||||
? InkWell(
|
? InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
controller.startLocationFromMapAll[index] = true;
|
controller.startLocationFromMapAll[index] = true;
|
||||||
controller.changeMainBottomMenuMap();
|
Get.back();
|
||||||
|
// controller.changeMainBottomMenuMap();
|
||||||
|
controller.changeWayPointStopsSheet();
|
||||||
controller.changePickerShown();
|
controller.changePickerShown();
|
||||||
},
|
},
|
||||||
child: Text(
|
child: Text(
|
||||||
'Choose from Map'.tr,
|
'Choose from Map $index'.tr,
|
||||||
style:
|
style:
|
||||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
mapPassengerController.changeWayPointSheet();
|
mapPassengerController.changeWayPointStopsSheet();
|
||||||
},
|
},
|
||||||
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
||||||
),
|
),
|
||||||
@@ -45,15 +45,18 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
ElevatedButton(
|
ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
wayPointController.addWayPoints();
|
wayPointController.addWayPoints();
|
||||||
|
controller.isWayPointStopsSheetUtilGetMap = true;
|
||||||
},
|
},
|
||||||
child: const Text('Add Text Field'),
|
child: const Text('Add Stops'),
|
||||||
),
|
),
|
||||||
wayPointController.wayPoints.length > 1
|
wayPointController.wayPoints.length > 1
|
||||||
? ElevatedButton(
|
? ElevatedButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
print(mapPassengerController.placesCoordinate
|
print(mapPassengerController.placesCoordinate
|
||||||
.toString());
|
.toString());
|
||||||
|
controller.clearPolyline();
|
||||||
|
controller.isWayPointStopsSheetUtilGetMap =
|
||||||
|
false;
|
||||||
for (var i = 0;
|
for (var i = 0;
|
||||||
i < wayPointController.wayPoints.length;
|
i < wayPointController.wayPoints.length;
|
||||||
i++) {
|
i++) {
|
||||||
@@ -127,37 +130,7 @@ class PointsPageForRider extends StatelessWidget {
|
|||||||
children: [
|
children: [
|
||||||
Text(mapPassengerController
|
Text(mapPassengerController
|
||||||
.currentLocationStringAll[index]
|
.currentLocationStringAll[index]
|
||||||
.toString())
|
.toString()),
|
||||||
// index == 0
|
|
||||||
// ? Text(
|
|
||||||
// mapPassengerController
|
|
||||||
// .currentLocationString0,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// )
|
|
||||||
// : index == 1
|
|
||||||
// ? Text(
|
|
||||||
// mapPassengerController
|
|
||||||
// .currentLocationString1,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// )
|
|
||||||
// : index == 2
|
|
||||||
// ? Text(
|
|
||||||
// mapPassengerController
|
|
||||||
// .currentLocationString2,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// )
|
|
||||||
// : index == 3
|
|
||||||
// ? Text(
|
|
||||||
// mapPassengerController
|
|
||||||
// .currentLocationString3,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// )
|
|
||||||
// : Text(
|
|
||||||
// mapPassengerController
|
|
||||||
// .currentLocationString4,
|
|
||||||
// style: AppStyle.title,
|
|
||||||
// ),
|
|
||||||
,
|
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.reorder,
|
Icons.reorder,
|
||||||
size: 20,
|
size: 20,
|
||||||
|
|||||||
Reference in New Issue
Block a user