getCurrentPosition function
Future<Position>
getCurrentPosition(
{ - LocationAccuracy desiredAccuracy = LocationAccuracy.medium,
- bool forceAndroidLocationManager = false,
- Duration? timeLimit = const Duration(seconds: 7),
})
Implementation
Future<Position> getCurrentPosition({
LocationAccuracy desiredAccuracy = LocationAccuracy.medium,
bool forceAndroidLocationManager = false,
Duration? timeLimit: const Duration(seconds: 7),
}) {
return Geolocator.getCurrentPosition(
desiredAccuracy: desiredAccuracy,
forceAndroidLocationManager: forceAndroidLocationManager,
timeLimit: timeLimit,
).asStream().first;
}