Skip to content
This repository was archived by the owner on Apr 10, 2024. It is now read-only.

Commit f1222a2

Browse files
author
Martin Braun
committed
fix: failed current location #52
1 parent fee4cc2 commit f1222a2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/providers/place_provider.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PlaceProvider extends ChangeNotifier {
4242
LocationAccuracy? desiredAccuracy;
4343
bool isAutoCompleteSearching = false;
4444

45-
Future<void> updateCurrentLocation(bool forceAndroidLocationManager) async {
45+
Future<void> updateCurrentLocation() async {
4646
bool serviceEnabled;
4747
LocationPermission permission;
4848

@@ -74,7 +74,9 @@ class PlaceProvider extends ChangeNotifier {
7474
'Location permissions are permanently denied, we cannot request permissions.');
7575
}
7676

77-
notifyListeners();
77+
_currentPosition = await Geolocator.getCurrentPosition(
78+
desiredAccuracy: desiredAccuracy ?? LocationAccuracy.best,
79+
);
7880
}
7981

8082
Position? _currentPosition;

0 commit comments

Comments
 (0)