+ 1
Hii friends,In my Flutter application My marker showing wrong co ordinates even though i have given correct c- ordinates,
Hii all,In my flutter Application I am trying to grab my Current location When i tested it I am getting Correct location ,But whe I Refreshed it I am getting Wrong Marker location.That too a constant Wrong Position. When i completly turned off the laptop and after some time only I am geetting Correct location ,And if Refresh Again same mistake is repeating Please help me flutter developers
1 Answer
0
import 'package:geolocator/geolocator.dart';
Future<Position> getCurrentLocation() async {
try {
return await Geolocator.getCurrentPosition(
desiredAccuracy: LocationAccuracy.best,
);
} catch (e) {
print("Error getting location: $e");
return null;
}
}