Merge pull request #1064 from RodXander/master

Fixed the unexpected behavior of InAppWebView and HeadlessInAppWebVie…
This commit is contained in:
Lorenzo Pichilli 2022-04-16 11:29:21 +02:00 committed by GitHub
commit a34ea8026b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 12 deletions

View File

@ -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() ?? {},

View File

@ -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() ?? {},
@ -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() ?? {},
@ -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() ?? {},