trip destination from current location
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Build and release APK / Build APK (pull_request) Failing after 5m54s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Build and release APK / Build APK (pull_request) Failing after 5m54s
				
			This commit is contained in:
		| @@ -6,6 +6,7 @@ import 'dart:developer'; | ||||
|  | ||||
| import 'package:anyway/structs/trip.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:geolocator/geolocator.dart'; | ||||
| import 'package:shared_preferences/shared_preferences.dart'; | ||||
|  | ||||
| class NewTripLocationSearch extends StatefulWidget { | ||||
| @@ -66,7 +67,17 @@ class _NewTripLocationSearchState extends State<NewTripLocationSearch> { | ||||
|  | ||||
|   late Widget useCurrentLocationButton = ElevatedButton( | ||||
|     onPressed: () async { | ||||
|        | ||||
|       // this widget is only shown if the user has already granted location permissions | ||||
|       Position position = await Geolocator.getCurrentPosition(); | ||||
|       widget.trip.landmarks.clear(); | ||||
|       widget.trip.addLandmark( | ||||
|         Landmark( | ||||
|           uuid: 'pending', | ||||
|           name: 'start', | ||||
|           location: [position.latitude, position.longitude], | ||||
|           type: typeStart | ||||
|         ) | ||||
|       ); | ||||
|     }, | ||||
|     child: Text('Use current location'), | ||||
|   ); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user