added travel from current location
This commit is contained in:
@ -1,6 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_map/plugin_api.dart';
|
||||
import 'package:geojson/geojson.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_state_manager/get_state_manager.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
@ -423,6 +425,25 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
],
|
||||
),
|
||||
),
|
||||
ElevatedButton(
|
||||
onPressed:() async {
|
||||
GeoJsonFeature<GeoJsonMultiPoint> mp = indexController.currentFeature[0] as GeoJsonFeature<GeoJsonMultiPoint>;
|
||||
Position position = await Geolocator.getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
|
||||
Destination ds = Destination(
|
||||
lat: position.latitude,
|
||||
lon: position.longitude
|
||||
);
|
||||
|
||||
Destination tp = Destination(
|
||||
lat: mp.geometry!.geoSerie!.geoPoints[0].latitude,
|
||||
lon: mp.geometry!.geoSerie!.geoPoints[0].longitude
|
||||
);
|
||||
|
||||
Get.back();
|
||||
|
||||
destinationController.destinationMatrixFromCurrentPoint([ds, tp]);
|
||||
},
|
||||
child:Text("ここへ行く")),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8.0,),
|
||||
@ -522,7 +543,7 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
indexController.rog_mode == 0 ?
|
||||
IconButton(
|
||||
@ -640,9 +661,9 @@ class BottomSheetNew extends GetView<BottomSheetController> {
|
||||
Container()
|
||||
|
||||
)
|
||||
)
|
||||
),
|
||||
],
|
||||
)
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user