Answer: Flutter geolocator package not retrieving location
Anurag Dhunna

Anurag Dhunna @anuragdhunna

About: -Versatile and experienced software developer with a strong foundation in Agile development methodologies. -Proficient in developing cutting-edge mobile applications using the Flutter framework. -Skil

Joined:
Jun 20, 2024

Answer: Flutter geolocator package not retrieving location

Publish Date: Jun 20 '24
0 0

Apple doesn't allow multiple active calls to the location stream.

Solution:

Future<Position>? _positionFuture
Future<Position> getLocation() async {
  if (_positionFuture != null) {
    // If a future is already in progress, return it directly
    return _positionFuture!;
  } else {
    // If no future is in progress, start a new one

Comments 0 total

    Add comment