getCurrentPosition function

Future<Position> getCurrentPosition({
  1. LocationAccuracy desiredAccuracy = LocationAccuracy.medium,
  2. bool forceAndroidLocationManager = false,
  3. 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;
}