This commit is contained in:
Hamza-Ayed
2024-01-27 00:53:44 +03:00
parent 91985fddf6
commit a63ebfe002
7 changed files with 270 additions and 259 deletions

View File

@@ -14,59 +14,76 @@ GetBuilder<MapPassengerController> formSearchPlaces() {
builder: (controller) => Column(
children: [
Padding(
padding: const EdgeInsets.all(16),
child: Container(
decoration:
const BoxDecoration(color: AppColor.secondaryColor),
child: TextField(
decoration: InputDecoration(
border: const OutlineInputBorder(
borderRadius: BorderRadius.only(),
gapPadding: 4,
borderSide: BorderSide(
color: AppColor.redColor,
width: 2,
)),
suffixIcon: const Icon(Icons.search),
hintText: controller.hintTextDestinationPoint,
hintStyle: AppStyle.title,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
controller.placeDestinationController.clear();
controller.clearPlacesDestination();
},
icon: Icon(
Icons.clear,
color: Colors.red[300],
padding: const EdgeInsets.all(12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: Get.width * .8,
decoration:
const BoxDecoration(color: AppColor.secondaryColor),
child: TextField(
decoration: InputDecoration(
border: const OutlineInputBorder(
borderRadius: BorderRadius.only(),
gapPadding: 4,
borderSide: BorderSide(
color: AppColor.redColor,
width: 2,
)),
suffixIcon: const Icon(Icons.search),
hintText: controller.hintTextDestinationPoint,
hintStyle: AppStyle.title,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
controller.placeDestinationController.clear();
controller.clearPlacesDestination();
},
icon: Icon(
Icons.clear,
color: Colors.red[300],
),
),
),
controller: controller.placeDestinationController,
onChanged: (value) {
if (controller
.placeDestinationController.text.length >
5) {
controller.getPlaces();
controller.changeHeightPlaces();
}
},
// onEditingComplete: () => controller.changeHeight(),
),
),
controller: controller.placeDestinationController,
onChanged: (value) {
if (controller.placeDestinationController.text.length >
5) {
controller.getPlaces();
controller.changeHeightPlaces();
}
},
// onEditingComplete: () => controller.changeHeight(),
),
),
),
controller.placesDestination.isEmpty
? InkWell(
onTap: () {
IconButton(
onPressed: () {
controller.changeMainBottomMenuMap();
controller.changePickerShown();
},
child: Text(
'Choose from Map'.tr,
style:
AppStyle.title.copyWith(color: AppColor.blueColor),
icon: const Icon(
Icons.map_outlined,
color: AppColor.greenColor,
),
)
: const SizedBox(),
),
],
),
),
// controller.placesDestination.isEmpty
// ? InkWell(
// onTap: () {
// controller.changeMainBottomMenuMap();
// controller.changePickerShown();
// },
// child: Text(
// 'Choose from Map'.tr,
// style:
// AppStyle.title.copyWith(color: AppColor.blueColor),
// ),
// )
// : const SizedBox(),
Container(
height: controller.placesDestination.isNotEmpty
? controller.height

View File

@@ -15,59 +15,76 @@ GetBuilder<MapPassengerController> formSearchPlacesStart() {
builder: (controller) => Column(
children: [
Padding(
padding: const EdgeInsets.all(16),
child: Container(
decoration:
const BoxDecoration(color: AppColor.secondaryColor),
child: TextField(
decoration: InputDecoration(
border: const OutlineInputBorder(
borderRadius: BorderRadius.only(),
gapPadding: 4,
borderSide: BorderSide(
color: AppColor.redColor,
width: 2,
)),
suffixIcon: const Icon(Icons.search),
hintText: controller.hintTextStartPoint,
hintStyle: AppStyle.title,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
controller.placeStartController.clear();
controller.clearPlacesStart();
},
icon: Icon(
Icons.clear,
color: Colors.red[300],
padding: const EdgeInsets.all(12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: Get.width * .8,
decoration:
const BoxDecoration(color: AppColor.secondaryColor),
child: TextField(
decoration: InputDecoration(
border: const OutlineInputBorder(
borderRadius: BorderRadius.only(),
gapPadding: 4,
borderSide: BorderSide(
color: AppColor.redColor,
width: 2,
)),
suffixIcon: const Icon(Icons.search),
hintText: controller.hintTextStartPoint,
hintStyle: AppStyle.title,
hintMaxLines: 1,
prefixIcon: IconButton(
onPressed: () {
controller.placeStartController.clear();
controller.clearPlacesStart();
},
icon: Icon(
Icons.clear,
color: Colors.red[300],
),
),
),
controller: controller.placeStartController,
onChanged: (value) {
if (controller.placeStartController.text.length > 5) {
controller.getPlacesStart();
controller.changeHeightStartPlaces();
}
},
// onEditingComplete: () => controller.changeHeight(),
),
),
controller: controller.placeStartController,
onChanged: (value) {
if (controller.placeStartController.text.length > 5) {
controller.getPlacesStart();
controller.changeHeightStartPlaces();
}
},
// onEditingComplete: () => controller.changeHeight(),
),
),
),
controller.placesDestination.isEmpty
? InkWell(
onTap: () {
IconButton(
onPressed: () {
controller.startLocationFromMap = true;
controller.changeMainBottomMenuMap();
controller.changePickerShown();
},
child: Text(
'Choose from Map'.tr,
style:
AppStyle.title.copyWith(color: AppColor.blueColor),
icon: const Icon(
Icons.map_outlined,
color: AppColor.yellowColor,
),
)
: const SizedBox(),
),
],
),
),
// controller.placesDestination.isEmpty
// ? InkWell(
// onTap: () {
// controller.startLocationFromMap = true;
// controller.changeMainBottomMenuMap();
// controller.changePickerShown();
// },
// child: Text(
// 'Choose from Map Start Point'.tr,
// style:
// AppStyle.title.copyWith(color: AppColor.blueColor),
// ),
// )
// : const SizedBox(),
Container(
height:
controller.placesStart.isNotEmpty ? controller.height : 0,

View File

@@ -176,19 +176,7 @@ class GoogleMapPassengerWidget extends StatelessWidget {
if (controller.haveSteps)
Marker(
markerId: MarkerId('EndSteps'.tr),
position: controller.newPointLocation4 == ''
? LatLng(
double.parse(
controller.placesCoordinate[3].split(',')[0]),
double.parse(
controller.placesCoordinate[3].split(',')[1]))
: controller.newPointLocation3 == ''
? LatLng(
double.parse(controller.placesCoordinate[2]
.split(',')[0]),
double.parse(controller.placesCoordinate[2]
.split(',')[1]))
: controller.newPointLocation2,
position: controller.latestPosition,
draggable: true,
icon: controller.endIcon,
),

View File

@@ -83,10 +83,6 @@ class MainBottomMenuMap extends StatelessWidget {
// print(controller.newMyLocation);
}
// await controller.getMap(
// '${controller.myLocation.latitude},${controller.myLocation.longitude}',
// '${controller.newMyLocation.latitude},${controller.newMyLocation.longitude}',
// );
controller.placesDestination = [];
controller
.placeDestinationController
@@ -245,7 +241,7 @@ class MainBottomMenuMap extends StatelessWidget {
height: 30,
),
MyElevatedButton(
title: 'Go to Ride',
title: 'Get Direction of Trip'.tr,
onPressed: () async {
controller.changeMainBottomMenuMap();
@@ -273,20 +269,20 @@ class MainBottomMenuMap extends StatelessWidget {
style: AppStyle.title,
),
),
IconButton(
onPressed: () {
FirebaseMessagesController()
.sendNotificationToAnyWithoutData(
'title',
'body',
// 'e5IXztYGS1W9zFvv-gmMRL:APA91bF7-fFzksCRXIk0Fm7IfQuhHL0df-vnDW8DNNKa3sWea649j3Obc8PhyJo9UOxKBtrvoJxYcbjclFKpvycAuhG0lv_e4hkavy-LZ6SsAu5J5bYrPz6-0BbyLdLUHoBuOFlNMvmN');
'eoV61-RSFUxLrCa88xaSG2:APA91bFmgGVTVH0mhjGhFqrB2_rMf0l0udBUzEUW-V2XlxtnYeDTnpESYRRCI_tMQnbDqQ3PK7pFMzW0-CZolS-pURSkwbwvnbVtV9VHB2UuOrKG3MYpGFsWfmjUdyRIOe30nx-eVkOu');
},
icon: const Icon(
Icons.add,
color: AppColor.blueColor,
),
),
// IconButton(
// onPressed: () {
// FirebaseMessagesController()
// .sendNotificationToAnyWithoutData(
// 'title',
// 'body',
// // 'e5IXztYGS1W9zFvv-gmMRL:APA91bF7-fFzksCRXIk0Fm7IfQuhHL0df-vnDW8DNNKa3sWea649j3Obc8PhyJo9UOxKBtrvoJxYcbjclFKpvycAuhG0lv_e4hkavy-LZ6SsAu5J5bYrPz6-0BbyLdLUHoBuOFlNMvmN');
// 'eoV61-RSFUxLrCa88xaSG2:APA91bFmgGVTVH0mhjGhFqrB2_rMf0l0udBUzEUW-V2XlxtnYeDTnpESYRRCI_tMQnbDqQ3PK7pFMzW0-CZolS-pURSkwbwvnbVtV9VHB2UuOrKG3MYpGFsWfmjUdyRIOe30nx-eVkOu');
// },
// icon: const Icon(
// Icons.add,
// color: AppColor.blueColor,
// ),
// ),
],
)
],

View File

@@ -35,12 +35,13 @@ class PointsPageForRider extends StatelessWidget {
children: [
IconButton(
onPressed: () {
mapPassengerController.changeWayPointStopsSheet();
mapPassengerController.downPoints();
},
icon: const Icon(Icons.arrow_drop_down_circle_outlined),
),
GetBuilder<WayPointController>(builder: (wayPointController) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
ElevatedButton(
onPressed: () {
@@ -55,7 +56,7 @@ class PointsPageForRider extends StatelessWidget {
mapPassengerController
.getMapPointsForAllMethods();
},
child: const Text('Get Map'),
child: const Text('Get Direction'),
)
: const SizedBox()
],