Skip to content

Commit ec7248e

Browse files
committed
Enable geolocation on Android
1 parent 13c9ac3 commit ec7248e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/src/base.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ class FlutterWebviewPlugin {
110110
bool supportMultipleWindows,
111111
bool appCacheEnabled,
112112
bool allowFileURLs,
113+
bool geolocationEnabled,
113114
}) async {
114115
final args = <String, dynamic>{
115116
'url': url,
@@ -126,6 +127,7 @@ class FlutterWebviewPlugin {
126127
'supportMultipleWindows': supportMultipleWindows ?? false,
127128
'appCacheEnabled': appCacheEnabled ?? false,
128129
'allowFileURLs': allowFileURLs ?? false,
130+
'geolocationEnabled': geolocationEnabled ?? false,
129131
};
130132

131133
if (headers != null) {

lib/src/webview_scaffold.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ class WebviewScaffold extends StatefulWidget {
3030
this.hidden = false,
3131
this.initialChild,
3232
this.allowFileURLs,
33+
this.geolocationEnabled
3334
}) : super(key: key);
3435

3536
final PreferredSizeWidget appBar;
@@ -52,6 +53,7 @@ class WebviewScaffold extends StatefulWidget {
5253
final bool hidden;
5354
final Widget initialChild;
5455
final bool allowFileURLs;
56+
final bool geolocationEnabled;
5557

5658
@override
5759
_WebviewScaffoldState createState() => _WebviewScaffoldState();
@@ -115,6 +117,7 @@ class _WebviewScaffoldState extends State<WebviewScaffold> {
115117
supportMultipleWindows: widget.supportMultipleWindows,
116118
appCacheEnabled: widget.appCacheEnabled,
117119
allowFileURLs: widget.allowFileURLs,
120+
geolocationEnabled: widget.geolocationEnabled
118121
);
119122
} else {
120123
if (_rect != value) {

0 commit comments

Comments
 (0)