Skip to content

Commit d762ba1

Browse files
authored
Bug fix where requestPermission method returns to quick (#787)
1 parent bb7ba80 commit d762ba1

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

geolocator_web/CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
## 2.0.5
2+
3+
- Ensure the `requestPermission` method correctly awaits the users input and not return prematurely (see issue [#783](https://github.com/Baseflow/flutter-geolocator/issues/783)).
4+
15
## 2.0.4
26

37
- Added an example App to demonstrate how to directly use the geolocator_web package in a Flutter application.
48

59
## 2.0.3
610

7-
- Implement missing `isLocationServiceEnabled` for web implementation (see issue[#694](https://github.com/Baseflow/flutter-geolocator/issues/694)).
11+
- Implement missing `isLocationServiceEnabled` for web implementation (see issue [#694](https://github.com/Baseflow/flutter-geolocator/issues/694)).
812

913
## 2.0.2
1014

geolocator_web/lib/geolocator_web.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class GeolocatorPlugin extends GeolocatorPlatform {
5959
@override
6060
Future<LocationPermission> requestPermission() async {
6161
try {
62-
_geolocation.getCurrentPosition();
62+
await _geolocation.getCurrentPosition();
6363
return LocationPermission.whileInUse;
6464
} catch (e) {
65-
return LocationPermission.denied;
65+
return LocationPermission.deniedForever;
6666
}
6767
}
6868

geolocator_web/pubspec.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: geolocator_web
22
description: Official web implementation of the geolocator plugin.
33
homepage: https://github.com/Baseflow/flutter-geolocator/tree/geolocator_web
4-
version: 2.0.4
4+
version: 2.0.5
55

66
flutter:
77
plugin:
@@ -16,7 +16,7 @@ dependencies:
1616
flutter_web_plugins:
1717
sdk: flutter
1818

19-
geolocator_platform_interface: ^2.3.0
19+
geolocator_platform_interface: ^2.3.2
2020

2121
dev_dependencies:
2222
flutter_test:
@@ -26,3 +26,4 @@ dev_dependencies:
2626
environment:
2727
sdk: '>=2.12.0 <3.0.0'
2828
flutter: ">=1.20.0"
29+

0 commit comments

Comments
 (0)