1/13/1
This commit is contained in:
3
.env
3
.env
@@ -17,4 +17,5 @@ cohere=Qfrhx9d5YVHiy4uEuK4wiFc9kIuFFlvc5A6WVzPK
|
||||
claudeAiAPI=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
|
||||
payPalClientId=AWj9MdPaA5Djpx8gOkvBn2qhP-3KvfB6W-l8USTsm19Xi2NhkNkE9QzosOvTPTsKjCMNffgpqStUA1-x
|
||||
payPalSecret=EKkasSl9O61lrfrbaJfXp1B-CIs2Rv71J0WPouxxugi38DsWaMhWpovJxN2ftYPQ0l6v9eoBvnyWkemp
|
||||
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
||||
geminiApi=AIzaSyADz49pIaeO1grPEcpV8HNCJijzekd037o
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@ android {
|
||||
minSdkVersion 23
|
||||
targetSdkVersion flutter.targetSdkVersion
|
||||
versionCode 15
|
||||
versionName '1.3.8'
|
||||
versionName '1.3.9'
|
||||
// manifestPlaceholders = [mapsApiKey: 'android/app/src/main/AndroidManifest.xml']
|
||||
}
|
||||
|
||||
signingConfigs {
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<category android:name="android.intent.category.LAUNCHER"/>
|
||||
</intent-filter>
|
||||
</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.android.application.versionCode" android:value="1"/>
|
||||
<!-- Don't delete the meta-data below.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<resources>
|
||||
<string name="app_name">My App</string>
|
||||
<string name="default_notification_channel_id">ride_channel</string>
|
||||
<string name="api_key">AIzaSyCyfwRXTwSTLOFQSQgN5p7QZgGJVZnEKq0</string>
|
||||
</resources>
|
||||
@@ -75,6 +75,7 @@ class AppLink {
|
||||
//-----------------Api Key------------------
|
||||
static String addApiKey = "$ride/apiKey/add.php";
|
||||
static String getApiKey = "$ride/apiKey/get.php";
|
||||
static String getCnMap = "$server/auth/cnMap.php";
|
||||
static String updateApiKey = "$ride/apiKey/update.php";
|
||||
static String deleteApiKey = "$ride/apiKey/delete.php";
|
||||
|
||||
|
||||
@@ -96,105 +96,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
|
||||
FirebaseMessaging.onMessage.listen((RemoteMessage message) {
|
||||
if (message.data.isNotEmpty) {
|
||||
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),
|
||||
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();
|
||||
}
|
||||
firebasetitles(message);
|
||||
}
|
||||
// If the app is in the background or terminated, show a system tray message
|
||||
RemoteNotification? notification = message.notification;
|
||||
@@ -203,106 +105,7 @@ class FirebaseMessagesController extends GetxController {
|
||||
if (notification != null && android != null) {
|
||||
// print('onMessageOpenedApp: ${notification.title} ${notification.body}');
|
||||
if (message.data.isNotEmpty) {
|
||||
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),
|
||||
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();
|
||||
}
|
||||
firebasetitles(message);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -311,110 +114,71 @@ class FirebaseMessagesController extends GetxController {
|
||||
// print(
|
||||
// 'onMessageOpenedApp: ${message.notification!.title} ${message.notification!.body}');
|
||||
RemoteNotification? notification = message.notification;
|
||||
if (message.data.isNotEmpty) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
firebasetitles(message);
|
||||
});
|
||||
}
|
||||
|
||||
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 {
|
||||
// Get the token you want to subtract.
|
||||
String token = box.read(BoxName.tokenFCM);
|
||||
|
||||
@@ -108,6 +108,8 @@ class MapPassengerController extends GetxController {
|
||||
bool rideConfirm = false;
|
||||
bool isMainBottomMenuMap = true;
|
||||
bool isWayPointSheet = false;
|
||||
bool isWayPointStopsSheet = false;
|
||||
bool isWayPointStopsSheetUtilGetMap = false;
|
||||
double heightBottomSheetShown = 0;
|
||||
double cashConfirmPageShown = 250;
|
||||
late String driverId;
|
||||
@@ -125,7 +127,7 @@ class MapPassengerController extends GetxController {
|
||||
double progress = 0;
|
||||
double progressTimerToPassengerFromDriverAfterApplied = 0;
|
||||
int durationTimer = 25;
|
||||
late int durationToRide;
|
||||
int durationToRide = 0;
|
||||
int remainingTime = 25;
|
||||
int remainingTimeToPassengerFromDriverAfterApplied = 60;
|
||||
int timeToPassengerFromDriverAfterApplied = 0;
|
||||
@@ -804,6 +806,7 @@ class MapPassengerController extends GetxController {
|
||||
shouldFetch = false;
|
||||
isPassengerChosen = false;
|
||||
isCashConfirmPageShown = false;
|
||||
totalStepDurations = 0;
|
||||
isCashSelectedBeforeConfirmRide = false;
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
changeCancelRidePageShow();
|
||||
@@ -826,6 +829,7 @@ class MapPassengerController extends GetxController {
|
||||
isPassengerChosen = false;
|
||||
isCashSelectedBeforeConfirmRide = false;
|
||||
isPickerShown = false;
|
||||
totalStepDurations = 0;
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
update();
|
||||
} else {
|
||||
@@ -843,6 +847,7 @@ class MapPassengerController extends GetxController {
|
||||
isCashConfirmPageShown = false;
|
||||
isCashSelectedBeforeConfirmRide = false;
|
||||
timeToPassengerFromDriverAfterApplied = 0;
|
||||
totalStepDurations = 0;
|
||||
changeCancelRidePageShow();
|
||||
remainingTime = 0;
|
||||
|
||||
@@ -862,16 +867,28 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void changeMainBottomMenuMap() {
|
||||
isMainBottomMenuMap = !isMainBottomMenuMap;
|
||||
mainBottomMenuMapHeight =
|
||||
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
|
||||
if (heightMenuBool == true) {
|
||||
getDrawerMenu();
|
||||
}
|
||||
getCoordinateFromMapWayPoints(int index) {
|
||||
placesCoordinate[index] = newStartPointLocation.toString();
|
||||
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() {
|
||||
isWayPointSheet = !isWayPointSheet;
|
||||
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .4;
|
||||
@@ -881,6 +898,16 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
void changeWayPointStopsSheet() {
|
||||
isWayPointStopsSheetUtilGetMap = true;
|
||||
isWayPointStopsSheet = !isWayPointStopsSheet;
|
||||
wayPointSheetHeight = isWayPointStopsSheet == false ? 0 : Get.height * .4;
|
||||
// if (heightMenuBool == true) {
|
||||
// getDrawerMenu();
|
||||
// }
|
||||
update();
|
||||
}
|
||||
|
||||
changeHeightPlaces() {
|
||||
if (placesDestination.isEmpty) {
|
||||
height = 0;
|
||||
@@ -986,49 +1013,49 @@ class MapPassengerController extends GetxController {
|
||||
update();
|
||||
}
|
||||
|
||||
Future getPlacesListsWayPoint1() async {
|
||||
var url =
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint1Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
// Future getPlacesListsWayPoint1() async {
|
||||
// var url =
|
||||
// '${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'];
|
||||
print(wayPoint1);
|
||||
update();
|
||||
}
|
||||
// wayPoint1 = response['results'];
|
||||
// print(wayPoint1);
|
||||
// update();
|
||||
// }
|
||||
|
||||
Future getPlacesListsWayPoint2() async {
|
||||
var url =
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint2Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
// Future getPlacesListsWayPoint2() async {
|
||||
// var url =
|
||||
// '${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'];
|
||||
print(wayPoint2);
|
||||
update();
|
||||
}
|
||||
// wayPoint2 = response['results'];
|
||||
// print(wayPoint2);
|
||||
// update();
|
||||
// }
|
||||
|
||||
Future getPlacesListsWayPoint3() async {
|
||||
var url =
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint3Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
// Future getPlacesListsWayPoint3() async {
|
||||
// var url =
|
||||
// '${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'];
|
||||
print(wayPoint3);
|
||||
update();
|
||||
}
|
||||
// wayPoint3 = response['results'];
|
||||
// print(wayPoint3);
|
||||
// update();
|
||||
// }
|
||||
|
||||
Future getPlacesListsWayPoint4() async {
|
||||
var url =
|
||||
'${AppLink.googleMapsLink}place/nearbysearch/json?keyword=${wayPoint4Controller.text}&location=${myLocation.latitude},${myLocation.longitude}&radius=50000&language=en&key=${AK.mapAPIKEY.toString()}';
|
||||
// Future getPlacesListsWayPoint4() async {
|
||||
// var url =
|
||||
// '${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'];
|
||||
print(wayPoint4);
|
||||
update();
|
||||
}
|
||||
// wayPoint4 = response['results'];
|
||||
// print(wayPoint4);
|
||||
// update();
|
||||
// }
|
||||
|
||||
LatLng fromString(String location) {
|
||||
List<String> parts = location.split(',');
|
||||
@@ -1367,7 +1394,9 @@ class MapPassengerController extends GetxController {
|
||||
}
|
||||
}
|
||||
|
||||
int totalStepDurations = 0;
|
||||
getMapPoints(String origin, destination, int index) async {
|
||||
isWayPointStopsSheetUtilGetMap = false;
|
||||
await getCarsLocationByPassenger();
|
||||
isLoading = false;
|
||||
update();
|
||||
@@ -1379,7 +1408,8 @@ class MapPassengerController extends GetxController {
|
||||
// print(data);
|
||||
isLoading = false;
|
||||
update();
|
||||
durationToRide = data[0]['duration']['value'];
|
||||
durationToRide = durationToRide + int.parse(data[0]['duration']['value']);
|
||||
// totalStepDurations = totalStepDurations + durationToRide;
|
||||
final points =
|
||||
decodePolyline(response["routes"][0]["overview_polyline"]["points"]);
|
||||
for (int i = 0; i < points.length; i++) {
|
||||
|
||||
@@ -27,7 +27,7 @@ Future<void> backgroundMessageHandler(RemoteMessage message) async {
|
||||
await Firebase.initializeApp();
|
||||
print('===========back===${message.notification?.title}');
|
||||
|
||||
if (message.notification!.title == 'Sefer') {}
|
||||
FirebaseMessagesController().firebasetitles(message);
|
||||
}
|
||||
|
||||
void main() async {
|
||||
|
||||
@@ -58,11 +58,13 @@ GetBuilder<MapPassengerController> formSearchPlaces(int index) {
|
||||
? InkWell(
|
||||
onTap: () {
|
||||
controller.startLocationFromMapAll[index] = true;
|
||||
controller.changeMainBottomMenuMap();
|
||||
Get.back();
|
||||
// controller.changeMainBottomMenuMap();
|
||||
controller.changeWayPointStopsSheet();
|
||||
controller.changePickerShown();
|
||||
},
|
||||
child: Text(
|
||||
'Choose from Map'.tr,
|
||||
'Choose from Map $index'.tr,
|
||||
style:
|
||||
AppStyle.title.copyWith(color: AppColor.blueColor),
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ class PointsPageForRider extends StatelessWidget {
|
||||
children: [
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
mapPassengerController.changeWayPointSheet();
|
||||
mapPassengerController.changeWayPointStopsSheet();
|
||||
},
|
||||
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
|
||||
),
|
||||
@@ -45,15 +45,18 @@ class PointsPageForRider extends StatelessWidget {
|
||||
ElevatedButton(
|
||||
onPressed: () {
|
||||
wayPointController.addWayPoints();
|
||||
controller.isWayPointStopsSheetUtilGetMap = true;
|
||||
},
|
||||
child: const Text('Add Text Field'),
|
||||
child: const Text('Add Stops'),
|
||||
),
|
||||
wayPointController.wayPoints.length > 1
|
||||
? ElevatedButton(
|
||||
onPressed: () {
|
||||
print(mapPassengerController.placesCoordinate
|
||||
.toString());
|
||||
|
||||
controller.clearPolyline();
|
||||
controller.isWayPointStopsSheetUtilGetMap =
|
||||
false;
|
||||
for (var i = 0;
|
||||
i < wayPointController.wayPoints.length;
|
||||
i++) {
|
||||
@@ -127,37 +130,7 @@ class PointsPageForRider extends StatelessWidget {
|
||||
children: [
|
||||
Text(mapPassengerController
|
||||
.currentLocationStringAll[index]
|
||||
.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,
|
||||
// ),
|
||||
,
|
||||
.toString()),
|
||||
const Icon(
|
||||
Icons.reorder,
|
||||
size: 20,
|
||||
|
||||
Reference in New Issue
Block a user