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+
15## 0.1.3+2
26
37- ` web: 1.0.0 ` compatibility: ` PermissionDescriptor ` was removed in web package.
Original file line number Diff line number Diff line change 11import 'dart:async' ;
2+ import 'dart:js_interop_unsafe' ;
23
34import 'package:web/web.dart' as web;
45
@@ -12,8 +13,15 @@ import 'web_delegate.dart';
1213class WebPermissionHandler extends PermissionHandlerPlatform {
1314 static final web.MediaDevices _devices = web.window.navigator.mediaDevices;
1415 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+ })();
1725
1826 final WebDelegate _webDelegate;
1927
Original file line number Diff line number Diff line change 11name : permission_handler_html
22description : 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
44
55homepage : https://github.com/baseflow/flutter-permission-handler
66
You can’t perform that action at this time.
0 commit comments