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( args.putIfAbsent(
'params', 'params',
() => <String, dynamic>{ () => <String, dynamic>{
'initialUrlRequest': (this.initialUrlRequest ?? 'initialUrlRequest': this.initialUrlRequest?.toMap(),
URLRequest(url: Uri.parse("about:blank")))
.toMap(),
'initialFile': this.initialFile, 'initialFile': this.initialFile,
'initialData': this.initialData?.toMap(), 'initialData': this.initialData?.toMap(),
'initialOptions': this.initialOptions?.toMap() ?? {}, 'initialOptions': this.initialOptions?.toMap() ?? {},

View File

@ -399,9 +399,7 @@ class _InAppWebViewState extends State<InAppWebView> {
viewType: 'com.pichillilorenzo/flutter_inappwebview', viewType: 'com.pichillilorenzo/flutter_inappwebview',
layoutDirection: TextDirection.rtl, layoutDirection: TextDirection.rtl,
creationParams: <String, dynamic>{ creationParams: <String, dynamic>{
'initialUrlRequest': (widget.initialUrlRequest ?? 'initialUrlRequest': widget.initialUrlRequest?.toMap(),
URLRequest(url: Uri.parse("about:blank")))
.toMap(),
'initialFile': widget.initialFile, 'initialFile': widget.initialFile,
'initialData': widget.initialData?.toMap(), 'initialData': widget.initialData?.toMap(),
'initialOptions': widget.initialOptions?.toMap() ?? {}, 'initialOptions': widget.initialOptions?.toMap() ?? {},
@ -430,9 +428,7 @@ class _InAppWebViewState extends State<InAppWebView> {
gestureRecognizers: widget.gestureRecognizers, gestureRecognizers: widget.gestureRecognizers,
layoutDirection: Directionality.maybeOf(context) ?? TextDirection.rtl, layoutDirection: Directionality.maybeOf(context) ?? TextDirection.rtl,
creationParams: <String, dynamic>{ creationParams: <String, dynamic>{
'initialUrlRequest': (widget.initialUrlRequest ?? 'initialUrlRequest': widget.initialUrlRequest?.toMap(),
URLRequest(url: Uri.parse("about:blank")))
.toMap(),
'initialFile': widget.initialFile, 'initialFile': widget.initialFile,
'initialData': widget.initialData?.toMap(), 'initialData': widget.initialData?.toMap(),
'initialOptions': widget.initialOptions?.toMap() ?? {}, 'initialOptions': widget.initialOptions?.toMap() ?? {},
@ -454,9 +450,7 @@ class _InAppWebViewState extends State<InAppWebView> {
onPlatformViewCreated: _onPlatformViewCreated, onPlatformViewCreated: _onPlatformViewCreated,
gestureRecognizers: widget.gestureRecognizers, gestureRecognizers: widget.gestureRecognizers,
creationParams: <String, dynamic>{ creationParams: <String, dynamic>{
'initialUrlRequest': (widget.initialUrlRequest ?? 'initialUrlRequest': widget.initialUrlRequest?.toMap(),
URLRequest(url: Uri.parse("about:blank")))
.toMap(),
'initialFile': widget.initialFile, 'initialFile': widget.initialFile,
'initialData': widget.initialData?.toMap(), 'initialData': widget.initialData?.toMap(),
'initialOptions': widget.initialOptions?.toMap() ?? {}, 'initialOptions': widget.initialOptions?.toMap() ?? {},