Skip to content

Commit eb92a1d

Browse files
Fix: PermissionDescriptor Error while checking the permission status on web (#1355)
* fixed permission status throwing error for permissionDescriptior is not passed * updated the version and changelog --------- Co-authored-by: Maurits van Beusekom <maurits@vnbskm.nl>
1 parent 5b4ff8d commit eb92a1d

File tree

3 files changed

+17
-11
lines changed

3 files changed

+17
-11
lines changed

permission_handler_html/CHANGELOG.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
1-
## 1.6.8
1+
## 0.1.3+1
2+
3+
- Fixes the PermissionDescriptor Error when getting the permission status.
4+
5+
## 0.1.3
26

37
* Adds support for `web: ^1.0.0`
48

59
## 0.1.2
610

7-
* Migrate to package:web and adding wasm support.
11+
- Migrate to package:web and adding wasm support.
812

913
## 0.1.1
1014

11-
* Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS and macOS).
15+
- Updates the dependency on `permission_handler_platform_interface` to version 4.1.0 (SiriKit support is only available for iOS and macOS).
1216

1317
## 0.1.0+2
1418

15-
* Fixes plugin initialization for non-https web app.
16-
* Fixes location permission name.
17-
* Improves error handling in the example app.
19+
- Fixes plugin initialization for non-https web app.
20+
- Fixes location permission name.
21+
- Improves error handling in the example app.
1822

1923
## 0.1.0+1
2024

21-
* Updates `permission_handler_platform_interface` dependency to version `^4.0.2`.
25+
- Updates `permission_handler_platform_interface` dependency to version `^4.0.2`.
2226

2327
## 0.1.0
2428

25-
* Adds an initial implementation of Web support for the permission_handler plugin with camera, notifications, and microphone permissions available.
29+
- Adds an initial implementation of Web support for the permission_handler plugin with camera, notifications, and microphone permissions available.

permission_handler_html/lib/web_delegate.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ class WebDelegate {
6262

6363
Future<PermissionStatus> _permissionStatusState(
6464
String webPermissionName, web.Permissions? permissions) async {
65-
final webPermissionStatus =
66-
await permissions?.query({'name': webPermissionName}.toJSBox).toDart;
65+
final webPermissionStatus = await permissions
66+
?.query(web.PermissionDescriptor(name: webPermissionName))
67+
.toDart;
6768
return _toPermissionStatus(webPermissionStatus?.state);
6869
}
6970

permission_handler_html/pubspec.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: permission_handler_html
22
description: Permission plugin for Flutter. This plugin provides the web API to request and check permissions.
3-
version: 0.1.3
3+
version: 0.1.3+1
4+
45
homepage: https://github.com/baseflow/flutter-permission-handler
56

67
environment:

0 commit comments

Comments
 (0)