From 1414d370f4590f2e51754f8ac96c2d26d73759a9 Mon Sep 17 00:00:00 2001 From: Mohamed Nouffer Date: Wed, 6 Mar 2024 15:07:14 +0530 Subject: [PATCH] fixed route --- lib/widgets/bottom_sheet_new.dart | 47 ++++++++++++++----------------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/lib/widgets/bottom_sheet_new.dart b/lib/widgets/bottom_sheet_new.dart index 553667a..dbcbf8e 100644 --- a/lib/widgets/bottom_sheet_new.dart +++ b/lib/widgets/bottom_sheet_new.dart @@ -362,34 +362,29 @@ class BottomSheetNew extends GetView { backgroundColor: Theme.of(context) .colorScheme .onPrimaryContainer), - onPressed: destinationController.distanceToStart() > - 500 - ? () async { - // print( - // "dist to start ${destinationController.distanceToStart()}"); - Get.back(); - //print("---- go to ----"); - GeoJSONMultiPoint mp = indexController - .currentFeature[0] as GeoJSONMultiPoint; - Position position = - await Geolocator.getCurrentPosition( - desiredAccuracy: LocationAccuracy - .bestForNavigation, - forceAndroidLocationManager: true); - //print("------- position -------- $position"); - Destination ds = Destination( - lat: position.latitude, - lon: position.longitude); + onPressed: () async { + // print( + // "dist to start ${destinationController.distanceToStart()}"); + Get.back(); + //print("---- go to ----"); + // GeoJSONMultiPoint mp = indexController + // .currentFeature[0] as GeoJSONMultiPoint; + Position position = + await Geolocator.getCurrentPosition( + desiredAccuracy: + LocationAccuracy.bestForNavigation, + forceAndroidLocationManager: true); + //print("------- position -------- $position"); + Destination ds = Destination( + lat: position.latitude, + lon: position.longitude); - Destination tp = Destination( - lat: mp.coordinates[0][1], - lon: mp.coordinates[0][0]); + Destination tp = Destination( + lat: destination.lat, lon: destination.lon); - destinationController - .destinationMatrixFromCurrentPoint( - [ds, tp]); - } - : null, + destinationController + .destinationMatrixFromCurrentPoint([ds, tp]); + }, //go here child: Text( "ここへ行く",