File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.3+3
2
+
3
+ - Safari < 16 compatibility: Don't crash on missing ` window.navigator.permissions ` property
4
+
1
5
## 0.1.3+2
2
6
3
7
- ` web: 1.0.0 ` compatibility: ` PermissionDescriptor ` was removed in web package.
Original file line number Diff line number Diff line change 1
1
import 'dart:async' ;
2
+ import 'dart:js_interop_unsafe' ;
2
3
3
4
import 'package:web/web.dart' as web;
4
5
@@ -12,8 +13,15 @@ import 'web_delegate.dart';
12
13
class WebPermissionHandler extends PermissionHandlerPlatform {
13
14
static final web.MediaDevices _devices = web.window.navigator.mediaDevices;
14
15
static final web.Geolocation _geolocation = web.window.navigator.geolocation;
15
- static final web.Permissions _htmlPermissions =
16
- web.window.navigator.permissions;
16
+ static final web.Permissions ? _htmlPermissions = (() {
17
+ // Using unsafe interop to check availability of `permissions`.
18
+ // It's not defined as nullable, so merely loading it into a web.Permission? variable
19
+ // causes the null-check to fail
20
+ if (! web.window.navigator.has ("permissions" )) {
21
+ return null ;
22
+ }
23
+ return web.window.navigator.permissions;
24
+ })();
17
25
18
26
final WebDelegate _webDelegate;
19
27
Original file line number Diff line number Diff line change 1
1
name : permission_handler_html
2
2
description : Permission plugin for Flutter. This plugin provides the web API to request and check permissions.
3
- version : 0.1.3+2
3
+ version : 0.1.3+3
4
4
5
5
homepage : https://github.com/baseflow/flutter-permission-handler
6
6
You can’t perform that action at this time.
0 commit comments