This commit is contained in:
Hamza-Ayed
2024-01-08 23:46:03 +03:00
parent 7d9bd9f62a
commit 783ae1a0ac
5 changed files with 220 additions and 137 deletions

View File

@@ -80,7 +80,8 @@ class MapPassengerController extends GetxController {
double widthMenu = 0;
double heightPickerContainer = 90;
double heightPointsPageForRider = 0;
double mainBottomMenuMap = Get.height * .2;
double mainBottomMenuMapHeight = Get.height * .2;
double wayPointSheetHeight = 0;
bool startLocationFromMap = false;
bool startLocationFromMap0 = false;
bool startLocationFromMap1 = false;
@@ -99,6 +100,7 @@ class MapPassengerController extends GetxController {
bool isRideFinished = false;
bool rideConfirm = false;
bool isMainBottomMenuMap = true;
bool isWayPointSheet = false;
double heightBottomSheetShown = 0;
double cashConfirmPageShown = 250;
late String driverId;
@@ -132,6 +134,12 @@ class MapPassengerController extends GetxController {
String hintTextwayPoint3 = 'Search for waypoint'.tr;
String hintTextwayPoint4 = 'Search for waypoint'.tr;
String currentLocationString = 'Current Location'.tr;
String currentLocationString0 = 'Current Location'.tr;
String currentLocationString1 = 'Current Location 1'.tr;
String currentLocationString2 = 'Current Location 2'.tr;
String currentLocationString3 = 'Current Location 3'.tr;
String currentLocationString4 = 'Current Location 4'.tr;
List<String> currentLocationStringAll = [];
String hintTextDestinationPoint = 'Search for your destination'.tr;
late String rideId;
bool noCarString = false;
@@ -197,6 +205,7 @@ class MapPassengerController extends GetxController {
update();
} else {
hintTextwayPoint0 = wayPoint0[index]['name'];
currentLocationString0 = wayPoint1[index]['name'];
double lat = wayPoint0[index]['geometry']['location']['lat'];
double lng = wayPoint0[index]['geometry']['location']['lng'];
newPointLocation0 = LatLng(lat, lng);
@@ -210,6 +219,7 @@ class MapPassengerController extends GetxController {
update();
} else {
hintTextwayPoint1 = wayPoint1[index]['name'];
currentLocationString1 = wayPoint1[index]['name'];
double lat = wayPoint1[index]['geometry']['location']['lat'];
double lng = wayPoint1[index]['geometry']['location']['lng'];
newPointLocation1 = LatLng(lat, lng);
@@ -223,6 +233,7 @@ class MapPassengerController extends GetxController {
update();
} else {
hintTextwayPoint2 = wayPoint2[index]['name'];
currentLocationString2 = wayPoint1[index]['name'];
double lat = wayPoint2[index]['geometry']['location']['lat'];
double lng = wayPoint2[index]['geometry']['location']['lng'];
newPointLocation2 = LatLng(lat, lng);
@@ -236,6 +247,7 @@ class MapPassengerController extends GetxController {
update();
} else {
hintTextwayPoint3 = wayPoint3[index]['name'];
currentLocationString3 = wayPoint1[index]['name'];
double lat = wayPoint3[index]['geometry']['location']['lat'];
double lng = wayPoint3[index]['geometry']['location']['lng'];
newPointLocation3 = LatLng(lat, lng);
@@ -249,6 +261,7 @@ class MapPassengerController extends GetxController {
update();
} else {
hintTextwayPoint4 = wayPoint4[index]['name'];
currentLocationString4 = wayPoint1[index]['name'];
double lat = wayPoint4[index]['geometry']['location']['lat'];
double lng = wayPoint4[index]['geometry']['location']['lng'];
newPointLocation4 = LatLng(lat, lng);
@@ -830,7 +843,7 @@ class MapPassengerController extends GetxController {
void changeMainBottomMenuMap() {
isMainBottomMenuMap = !isMainBottomMenuMap;
mainBottomMenuMap =
mainBottomMenuMapHeight =
isMainBottomMenuMap == true ? Get.height * .2 : Get.height * .7;
if (heightMenuBool == true) {
getDrawerMenu();
@@ -838,6 +851,15 @@ class MapPassengerController extends GetxController {
update();
}
void changeWayPointSheet() {
isWayPointSheet = !isWayPointSheet;
wayPointSheetHeight = isWayPointSheet == false ? 0 : Get.height * .7;
// if (heightMenuBool == true) {
// getDrawerMenu();
// }
update();
}
changeHeightPlaces() {
if (placesDestination.isEmpty) {
height = 0;
@@ -1473,18 +1495,7 @@ class MapPassengerController extends GetxController {
List<LatLng> polylineCoordinate = [];
String? cardNumber;
@override
void onInit() async {
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
await getLocation();
await addToken();
await getCarsLocationByPassenger();
getNearestDriverByPassengerLocation();
addCustomPicker();
addCustomCarIcon();
addCustomTripIcon();
startMarkerReloading();
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
void readyWayPoints() {
allTextEditingPlaces = [
wayPoint0Controller,
wayPoint1Controller,
@@ -1499,11 +1510,33 @@ class MapPassengerController extends GetxController {
wayPoint3,
wayPoint4
];
// placeListResponse.add(wayPoint0);
currentLocationStringAll = [
currentLocationString0,
currentLocationString1,
currentLocationString2,
currentLocationString3,
currentLocationString4,
]; // placeListResponse.add(wayPoint0);
// placeListResponse.add(wayPoint1);
// placeListResponse.add(wayPoint2);
// placeListResponse.add(wayPoint3);
// placeListResponse.add(wayPoint4);
}
@override
void onInit() async {
mapAPIKEY = await storage.read(key: BoxName.mapAPIKEY);
await getLocation();
await addToken();
await getCarsLocationByPassenger();
getNearestDriverByPassengerLocation();
addCustomPicker();
addCustomCarIcon();
addCustomTripIcon();
startMarkerReloading();
cardNumber = await SecureStorage().readData(BoxName.cardNumber);
readyWayPoints();
super.onInit();
}
}