We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b3c04a commit a6ab3cfCopy full SHA for a6ab3cf
lib/core/services/location_services.dart
@@ -14,11 +14,17 @@ class LocationService {
14
Position? get currentPosition => _currentPosition;
15
16
Future<Position?> getCurrentLocation() async {
17
+ // ignore: unused_local_variable
18
bool serviceEnabled;
19
20
LocationPermission permission;
21
22
serviceEnabled = await Geolocator.isLocationServiceEnabled();
23
24
+ if (!serviceEnabled) {
25
+ return Future.error('Location service is disabled.');
26
+ }
27
+
28
permission = await Geolocator.checkPermission();
29
30
if (permission == LocationPermission.denied) {
0 commit comments