fix: stabilize passenger mapping interactions and finalize localization
This commit is contained in:
@@ -9,7 +9,7 @@ import 'package:Intaleq/controller/home/map_passenger_controller.dart';
|
||||
import 'package:Intaleq/main.dart';
|
||||
import 'package:Intaleq/views/home/map_widget.dart/form_search_places_destenation.dart';
|
||||
import 'package:Intaleq/views/widgets/elevated_btn.dart';
|
||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||
import 'package:intaleq_maps/intaleq_maps.dart';
|
||||
import '../../../constant/colors.dart';
|
||||
import '../../../constant/table_names.dart';
|
||||
import '../../widgets/error_snakbar.dart';
|
||||
@@ -607,26 +607,32 @@ class _MapPickerOverlay extends StatelessWidget {
|
||||
const _MapPickerOverlay({required this.controller});
|
||||
|
||||
String _getModeTitle(BuildContext context) {
|
||||
if (controller.isPickingWaypoint)
|
||||
if (controller.isPickingWaypoint) {
|
||||
return 'Move map to set stop'.tr +
|
||||
' ${controller.pickingWaypointIndex + 1}'.tr;
|
||||
if (controller.passengerStartLocationFromMap)
|
||||
}
|
||||
if (controller.passengerStartLocationFromMap) {
|
||||
return controller.isAnotherOreder
|
||||
? 'Now set the pickup point for the other person'.tr
|
||||
: 'Move map to your pickup point'.tr;
|
||||
if (controller.startLocationFromMap)
|
||||
}
|
||||
if (controller.startLocationFromMap) {
|
||||
return 'Move map to set start location'.tr;
|
||||
if (controller.workLocationFromMap)
|
||||
}
|
||||
if (controller.workLocationFromMap) {
|
||||
return 'Move map to your work location'.tr;
|
||||
if (controller.homeLocationFromMap)
|
||||
}
|
||||
if (controller.homeLocationFromMap) {
|
||||
return 'Move map to your home location'.tr;
|
||||
}
|
||||
return 'Move map to select destination'.tr;
|
||||
}
|
||||
|
||||
String _getConfirmLabel(BuildContext context) {
|
||||
if (controller.isPickingWaypoint) return 'Set as Stop'.tr;
|
||||
if (controller.passengerStartLocationFromMap)
|
||||
if (controller.passengerStartLocationFromMap) {
|
||||
return 'Confirm Pickup Location'.tr;
|
||||
}
|
||||
if (controller.workLocationFromMap) return 'Set as Work'.tr;
|
||||
if (controller.homeLocationFromMap) return 'Set as Home'.tr;
|
||||
return 'Set Destination'.tr;
|
||||
@@ -634,8 +640,9 @@ class _MapPickerOverlay extends StatelessWidget {
|
||||
|
||||
IconData _getModeIcon() {
|
||||
if (controller.isPickingWaypoint) return Icons.add_location_alt_rounded;
|
||||
if (controller.passengerStartLocationFromMap)
|
||||
if (controller.passengerStartLocationFromMap) {
|
||||
return Icons.person_pin_circle_rounded;
|
||||
}
|
||||
if (controller.workLocationFromMap) return Icons.work_rounded;
|
||||
if (controller.homeLocationFromMap) return Icons.home_rounded;
|
||||
return Icons.location_on_rounded;
|
||||
@@ -760,6 +767,8 @@ class _MapPickerOverlay extends StatelessWidget {
|
||||
|
||||
Future<void> _onConfirmTap(
|
||||
MapPassengerController controller, BuildContext context) async {
|
||||
Log.print(
|
||||
'🔘 _onConfirmTap: isPickingWaypoint=${controller.isPickingWaypoint}, newMyLocation=${controller.newMyLocation}');
|
||||
await Future.delayed(const Duration(milliseconds: 280));
|
||||
final LatLng currentCameraPosition = LatLng(
|
||||
controller.newMyLocation.latitude, controller.newMyLocation.longitude);
|
||||
@@ -905,7 +914,6 @@ class _RecentPlaceChip extends StatelessWidget {
|
||||
'Are you want to go this site'.tr,
|
||||
' ',
|
||||
() async {
|
||||
Get.back();
|
||||
await controller.getLocation();
|
||||
await controller.getDirectionMap(
|
||||
'${controller.passengerLocation.latitude},${controller.passengerLocation.longitude}',
|
||||
|
||||
Reference in New Issue
Block a user