diff --git a/lib/src/in_app_webview/headless_in_app_webview.dart b/lib/src/in_app_webview/headless_in_app_webview.dart index 4e1460a1..47ab3f35 100644 --- a/lib/src/in_app_webview/headless_in_app_webview.dart +++ b/lib/src/in_app_webview/headless_in_app_webview.dart @@ -140,9 +140,7 @@ class HeadlessInAppWebView implements WebView { args.putIfAbsent( 'params', () => { - 'initialUrlRequest': (this.initialUrlRequest ?? - URLRequest(url: Uri.parse("about:blank"))) - .toMap(), + 'initialUrlRequest': this.initialUrlRequest?.toMap(), 'initialFile': this.initialFile, 'initialData': this.initialData?.toMap(), 'initialOptions': this.initialOptions?.toMap() ?? {}, diff --git a/lib/src/in_app_webview/in_app_webview.dart b/lib/src/in_app_webview/in_app_webview.dart index f60f956f..4c3f7f3e 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -399,9 +399,7 @@ class _InAppWebViewState extends State { viewType: 'com.pichillilorenzo/flutter_inappwebview', layoutDirection: TextDirection.rtl, creationParams: { - 'initialUrlRequest': (widget.initialUrlRequest ?? - URLRequest(url: Uri.parse("about:blank"))) - .toMap(), + 'initialUrlRequest': widget.initialUrlRequest?.toMap(), 'initialFile': widget.initialFile, 'initialData': widget.initialData?.toMap(), 'initialOptions': widget.initialOptions?.toMap() ?? {}, @@ -430,9 +428,7 @@ class _InAppWebViewState extends State { gestureRecognizers: widget.gestureRecognizers, layoutDirection: Directionality.maybeOf(context) ?? TextDirection.rtl, creationParams: { - 'initialUrlRequest': (widget.initialUrlRequest ?? - URLRequest(url: Uri.parse("about:blank"))) - .toMap(), + 'initialUrlRequest': widget.initialUrlRequest?.toMap(), 'initialFile': widget.initialFile, 'initialData': widget.initialData?.toMap(), 'initialOptions': widget.initialOptions?.toMap() ?? {}, @@ -454,9 +450,7 @@ class _InAppWebViewState extends State { onPlatformViewCreated: _onPlatformViewCreated, gestureRecognizers: widget.gestureRecognizers, creationParams: { - 'initialUrlRequest': (widget.initialUrlRequest ?? - URLRequest(url: Uri.parse("about:blank"))) - .toMap(), + 'initialUrlRequest': widget.initialUrlRequest?.toMap(), 'initialFile': widget.initialFile, 'initialData': widget.initialData?.toMap(), 'initialOptions': widget.initialOptions?.toMap() ?? {},