Explorar o código

Enable geolocation on Android

Luciano Iammarino %!s(int64=6) %!d(string=hai) anos
pai
achega
50122c710c
Modificáronse 2 ficheiros con 5 adicións e 0 borrados
  1. 2 0
      lib/src/base.dart
  2. 3 0
      lib/src/webview_scaffold.dart

+ 2 - 0
lib/src/base.dart

@@ -110,6 +110,7 @@ class FlutterWebviewPlugin {
     bool supportMultipleWindows,
     bool appCacheEnabled,
     bool allowFileURLs,
+    bool geolocationEnabled,
   }) async {
     final args = <String, dynamic>{
       'url': url,
@@ -126,6 +127,7 @@ class FlutterWebviewPlugin {
       'supportMultipleWindows': supportMultipleWindows ?? false,
       'appCacheEnabled': appCacheEnabled ?? false,
       'allowFileURLs': allowFileURLs ?? false,
+      'geolocationEnabled': geolocationEnabled ?? false,
     };
 
     if (headers != null) {

+ 3 - 0
lib/src/webview_scaffold.dart

@@ -30,6 +30,7 @@ class WebviewScaffold extends StatefulWidget {
     this.hidden = false,
     this.initialChild,
     this.allowFileURLs,
+    this.geolocationEnabled
   }) : super(key: key);
 
   final PreferredSizeWidget appBar;
@@ -52,6 +53,7 @@ class WebviewScaffold extends StatefulWidget {
   final bool hidden;
   final Widget initialChild;
   final bool allowFileURLs;
+  final bool geolocationEnabled;
 
   @override
   _WebviewScaffoldState createState() => _WebviewScaffoldState();
@@ -115,6 +117,7 @@ class _WebviewScaffoldState extends State<WebviewScaffold> {
               supportMultipleWindows: widget.supportMultipleWindows,
               appCacheEnabled: widget.appCacheEnabled,
               allowFileURLs: widget.allowFileURLs,
+              geolocationEnabled: widget.geolocationEnabled
             );
           } else {
             if (_rect != value) {