Fixed the unexpected behavior of InAppWebView and HeadlessInAppWebView when initialUrlRequest was set as null.
This commit is contained in:
parent
f06bcdf695
commit
440ff81803
|
@ -139,9 +139,7 @@ class HeadlessInAppWebView implements WebView {
|
|||
args.putIfAbsent(
|
||||
'params',
|
||||
() => <String, dynamic>{
|
||||
'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() ?? {},
|
||||
|
|
|
@ -395,9 +395,7 @@ class _InAppWebViewState extends State<InAppWebView> {
|
|||
viewType: 'com.pichillilorenzo/flutter_inappwebview',
|
||||
layoutDirection: TextDirection.rtl,
|
||||
creationParams: <String, dynamic>{
|
||||
'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<InAppWebView> {
|
|||
gestureRecognizers: widget.gestureRecognizers,
|
||||
layoutDirection: TextDirection.rtl,
|
||||
creationParams: <String, dynamic>{
|
||||
'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<InAppWebView> {
|
|||
onPlatformViewCreated: _onPlatformViewCreated,
|
||||
gestureRecognizers: widget.gestureRecognizers,
|
||||
creationParams: <String, dynamic>{
|
||||
'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() ?? {},
|
||||
|
|
Loading…
Reference in New Issue