You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This method per the documentation seems to work perfectly on iOS and Android but on Web I'm getting a random type error within the package.
Here's my code:
_serviceEnabled = await location.serviceEnabled();
if (!_serviceEnabled) {
_serviceEnabled = await location.requestService();
if (!_serviceEnabled) {
StackTrace.current
.printWithInfo('No User Location Available: Services Not Enabled!');
streamController.add(_initialFocusLocation);
return;
}
}
_permissionGranted = await location.hasPermission();
if (_permissionGranted == PermissionStatus.denied ||
_permissionGranted == PermissionStatus.deniedForever) {
_permissionGranted = await location.requestPermission();
if (_permissionGranted != PermissionStatus.granted ||
_permissionGranted != PermissionStatus.grantedLimited) {
StackTrace.current
.printWithInfo('No User Location Available: Permission Not Granted!');
streamController.add(_initialFocusLocation);
return;
}
}
The error is thrown at location.hasPermission() and serviceEnabled returns true.
TypeError: Failed to execute 'query' on 'Permissions': Failed to read the 'name' property from 'PermissionDescriptor': Required member is undefined.
packages/location_web/location_web.dart 60:15 hasPermission
Does anyone have this working on the web?
Tested on:
Packages and versions:
location: 6.0.2
flutter: 3.22.2
dart: 3.4.3
Expected Behavior:
On iOS and Android, this code works fine regardless of permission level. I would expect it to return some enum value instead of throwing a TypeError. Even if the location is not supported on the web at all, I would expect some level of a named error with instructions on some resolution or advising not to use this package and method for this platform.
The text was updated successfully, but these errors were encountered:
Describe the bug
This method per the documentation seems to work perfectly on iOS and Android but on Web I'm getting a random type error within the package.
Here's my code:
The error is thrown at location.hasPermission() and serviceEnabled returns true.
Does anyone have this working on the web?
Tested on:
Packages and versions:
location: 6.0.2
flutter: 3.22.2
dart: 3.4.3
Expected Behavior:
On iOS and Android, this code works fine regardless of permission level. I would expect it to return some enum value instead of throwing a TypeError. Even if the location is not supported on the web at all, I would expect some level of a named error with instructions on some resolution or advising not to use this package and method for this platform.
The text was updated successfully, but these errors were encountered: