Skip to content

Commit

Permalink
Merge pull request #1064 from RodXander/master
Browse files Browse the repository at this point in the history
Fixed the unexpected behavior of InAppWebView and HeadlessInAppWebVie…
  • Loading branch information
pichillilorenzo authored Apr 16, 2022
2 parents 5666c68 + 440ff81 commit a34ea80
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions lib/src/in_app_webview/headless_in_app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,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() ?? {},
Expand Down
12 changes: 3 additions & 9 deletions lib/src/in_app_webview/in_app_webview.dart
Original file line number Diff line number Diff line change
Expand Up @@ -399,9 +399,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() ?? {},
Expand Down Expand Up @@ -430,9 +428,7 @@ class _InAppWebViewState extends State<InAppWebView> {
gestureRecognizers: widget.gestureRecognizers,
layoutDirection: Directionality.maybeOf(context) ?? 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() ?? {},
Expand All @@ -454,9 +450,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() ?? {},
Expand Down

0 comments on commit a34ea80

Please sign in to comment.