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 f19b5152..3185aa92 100644 --- a/lib/src/in_app_webview/headless_in_app_webview.dart +++ b/lib/src/in_app_webview/headless_in_app_webview.dart @@ -139,9 +139,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 7ef7ee2f..f16e5eb5 100755 --- a/lib/src/in_app_webview/in_app_webview.dart +++ b/lib/src/in_app_webview/in_app_webview.dart @@ -395,9 +395,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() ?? {}, @@ -425,9 +423,7 @@ class _InAppWebViewState extends State { gestureRecognizers: widget.gestureRecognizers, 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() ?? {}, @@ -448,9 +444,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() ?? {},