This commit is contained in:
Hamza-Ayed
2023-12-31 00:11:49 +03:00
parent 1b9b0dc9e8
commit c2dc5ec44c
21 changed files with 792 additions and 496 deletions

View File

@@ -29,13 +29,13 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
width: 2,
)),
suffixIcon: const Icon(Icons.search),
hintText: 'Search for your destination'.tr,
hintText: controller.hintTextDestinationPoint,
hintStyle: AppStyle.title,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
controller.placeController.clear();
controller.clearPlaces();
controller.placeDestinationController.clear();
controller.clearPlacesDestination();
},
icon: Icon(
Icons.clear,
@@ -43,18 +43,19 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
),
),
),
controller: controller.placeController,
controller: controller.placeDestinationController,
onChanged: (value) {
if (controller.placeController.text.length > 5) {
if (controller.placeDestinationController.text.length >
5) {
controller.getPlaces();
controller.changeHeight();
controller.changeHeightPlaces();
}
},
// onEditingComplete: () => controller.changeHeight(),
),
),
),
controller.places.isEmpty
controller.placesDestination.isEmpty
? InkWell(
onTap: () {
controller.changeMainBottomMenuMap();
@@ -68,37 +69,25 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
)
: const SizedBox(),
Container(
height: controller.places.isNotEmpty ? controller.height : 0,
height: controller.placesDestination.isNotEmpty
? controller.height
: 0,
color: AppColor.secondaryColor,
child: ListView.builder(
itemCount: controller.places.length,
itemCount: controller.placesDestination.length,
itemBuilder: (BuildContext context, int index) {
var res = controller.places[index];
var res = controller.placesDestination[index];
return InkWell(
onTap: () {
controller.changeHeight();
Get.defaultDialog(
title:
'${'Are You sure to ride to'.tr} ${res['name']}',
middleText: '',
titleStyle: AppStyle.title,
confirm: MyElevatedButton(
title: 'Confirm'.tr,
onPressed: () async {
controller.clearPolyline();
controller.data = [];
await controller.getMap(
'${controller.myLocation.latitude.toString()},${controller.myLocation.longitude.toString()}',
"${res['geometry']['location']['lat']},${res['geometry']['location']['lng']}");
controller.places = [];
controller.placeController.clear();
onTap: () async {
controller.changeHeightPlaces();
controller.showBottomSheet1();
Get.back();
controller.showBottomSheet1();
controller.changeMainBottomMenuMap();
}),
);
controller.changeHeightPlaces();
controller.myLocation = controller.newMyLocation;
controller.convertHintTextDestinationNewPlaces(index);
controller.placesDestination = [];
controller.placeDestinationController.clear();
},
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),