4/26/1
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:SEFER/controller/home/map_passenger_controller.dart';
|
||||
import 'package:SEFER/main.dart';
|
||||
import 'package:SEFER/views/home/map_widget.dart/form_search_places_destenation.dart';
|
||||
import 'package:SEFER/views/widgets/elevated_btn.dart';
|
||||
import 'package:google_maps_flutter/google_maps_flutter.dart';
|
||||
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
@@ -78,18 +79,18 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
controller.isMainBottomMenuMap
|
||||
? recentPlacesWidget(controller)
|
||||
: const SizedBox(),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: InkWell(
|
||||
onTap: () async {
|
||||
controller.getCurrentLocationFormString();
|
||||
},
|
||||
child: Text(
|
||||
'From :'.tr +
|
||||
' ${controller.currentLocationString}'.tr,
|
||||
style: AppStyle.subtitle,
|
||||
),
|
||||
),
|
||||
// controller.isMainBottomMenuMap
|
||||
// ? const SizedBox()
|
||||
// : InkWell(
|
||||
// onTap: () async {
|
||||
// controller.getCurrentLocationFormString();
|
||||
// },
|
||||
// child: Text(
|
||||
// 'From :'.tr +
|
||||
// ' ${controller.currentLocationString}'.tr,
|
||||
// style: AppStyle.subtitle,
|
||||
// ),
|
||||
// ),
|
||||
controller.isMainBottomMenuMap
|
||||
? const SizedBox()
|
||||
: Column(
|
||||
@@ -204,7 +205,27 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
onPressed: () async {
|
||||
controller.clearPolyline();
|
||||
controller.data = [];
|
||||
if (controller.startLocationFromMap == true) {
|
||||
if (controller.passengerStartLocationFromMap == true) {
|
||||
controller.newMyLocation = controller.newStartPointLocation;
|
||||
controller.changeMainBottomMenuMap();
|
||||
|
||||
await controller.getMap(
|
||||
'${controller.newStartPointLocation.latitude},${controller.newStartPointLocation.longitude}',
|
||||
'${controller.myDestination.latitude},${controller.myDestination.longitude}',
|
||||
);
|
||||
controller.currentLocationToFormPlaces = false;
|
||||
controller.placesDestination = [];
|
||||
// controller.isCancelRidePageShown = true;
|
||||
controller.clearPlacesStart();
|
||||
controller.clearPlacesDestination();
|
||||
controller.passengerStartLocationFromMap = false;
|
||||
controller.isPickerShown = false;
|
||||
// controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// controller.hintTextStartPoint =
|
||||
// '${controller.newStartPointLocation.latitude.toStringAsFixed(4)} , ${controller.newStartPointLocation.longitude.toStringAsFixed(4)}';
|
||||
} else if (controller.startLocationFromMap == true) {
|
||||
controller.newMyLocation = controller.newStartPointLocation;
|
||||
controller.hintTextStartPoint =
|
||||
'${controller.newStartPointLocation.latitude.toStringAsFixed(4)} , ${controller.newStartPointLocation.longitude.toStringAsFixed(4)}';
|
||||
@@ -232,16 +253,36 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
} else {
|
||||
controller.hintTextDestinationPoint =
|
||||
'${controller.newMyLocation.latitude.toStringAsFixed(4)} , ${controller.newMyLocation.longitude.toStringAsFixed(4)}';
|
||||
controller.newMyLocation = controller.newMyLocation;
|
||||
controller.myDestination = controller.newMyLocation;
|
||||
controller.isPickerShown = false;
|
||||
|
||||
controller.changeMainBottomMenuMap();
|
||||
controller.passengerStartLocationFromMap = true;
|
||||
controller.isPickerShown = true;
|
||||
await controller.mapController?.animateCamera(CameraUpdate.newLatLng(
|
||||
LatLng(controller.passengerLocation.latitude,
|
||||
controller.passengerLocation.longitude)));
|
||||
Get.defaultDialog(
|
||||
title: 'Destination selected'.tr,
|
||||
titleStyle: AppStyle.title,
|
||||
content: Text(
|
||||
'Now select start pick'.tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
confirm: MyElevatedButton(
|
||||
title: 'OK'.tr,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
}));
|
||||
}
|
||||
|
||||
controller.placesDestination = [];
|
||||
controller.placeDestinationController.clear();
|
||||
|
||||
controller.showBottomSheet1();
|
||||
Get.back();
|
||||
controller.showBottomSheet1();
|
||||
// Get.back();
|
||||
// controller.showBottomSheet1();
|
||||
|
||||
controller.changeMainBottomMenuMap();
|
||||
},
|
||||
child: Row(
|
||||
@@ -261,7 +302,9 @@ class MainBottomMenuMap extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"Click here point".tr,
|
||||
controller.passengerStartLocationFromMap
|
||||
? 'Pick your ride location on the map - Tap to confirm'.tr
|
||||
: "Click here point".tr,
|
||||
style: AppStyle.title,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user