Skip to content

Commit a6ab3cf

Browse files
author
himanshu goyal
committed
fix unused variable in location service
1 parent 2b3c04a commit a6ab3cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/core/services/location_services.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@ class LocationService {
1414
Position? get currentPosition => _currentPosition;
1515

1616
Future<Position?> getCurrentLocation() async {
17+
// ignore: unused_local_variable
1718
bool serviceEnabled;
19+
// ignore: unused_local_variable
1820
LocationPermission permission;
1921

2022
serviceEnabled = await Geolocator.isLocationServiceEnabled();
2123

24+
if (!serviceEnabled) {
25+
return Future.error('Location service is disabled.');
26+
}
27+
2228
permission = await Geolocator.checkPermission();
2329

2430
if (permission == LocationPermission.denied) {

0 commit comments

Comments
 (0)