Anurag Dhunna
Posted on June 20, 2024
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
…
💖 💪 🙅 🚩
Anurag Dhunna
Posted on June 20, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.