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
β¦
Top comments (0)