This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[webview_flutter_android] Updates pigeon version to support null safety#5395
Merged
bparrishMines merged 9 commits intoflutter:mainfrom Apr 28, 2022
Merged
[webview_flutter_android] Updates pigeon version to support null safety#5395bparrishMines merged 9 commits intoflutter:mainfrom
pigeon version to support null safety#5395bparrishMines merged 9 commits intoflutter:mainfrom
Conversation
pigeon version to support null safety
bparrishMines
commented
Apr 27, 2022
| .setRequestHeaders( | ||
| request.getRequestHeaders() != null | ||
| ? request.getRequestHeaders() | ||
| : new HashMap<>()); |
Contributor
Author
There was a problem hiding this comment.
Apparently request.getRequestHeaders() can return null
04-27 07:50:01.128: D/AndroidRuntime(21722): Shutting down VM
04-27 07:50:01.128: D/AndroidRuntime(21722): --------- beginning of crash
04-27 07:50:01.128: E/AndroidRuntime(21722): FATAL EXCEPTION: main
04-27 07:50:01.128: E/AndroidRuntime(21722): Process: io.flutter.plugins.webviewflutterandroidexample, PID: 21722
04-27 07:50:01.128: E/AndroidRuntime(21722): java.lang.IllegalStateException: Nonnull field "requestHeaders" is null.
04-27 07:50:01.128: E/AndroidRuntime(21722): at io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebResourceRequestData.setRequestHeaders(GeneratedAndroidWebView.java:103)
04-27 07:50:01.128: E/AndroidRuntime(21722): at io.flutter.plugins.webviewflutter.GeneratedAndroidWebView$WebResourceRequestData$Builder.build(GeneratedAndroidWebView.java:161)
04-27 07:50:01.128: E/AndroidRuntime(21722): at io.flutter.plugins.webviewflutter.WebViewClientFlutterApiImpl.createWebResourceRequestData(WebViewClientFlutterApiImpl.java:58)
04-27 07:50:01.128: E/AndroidRuntime(21722): at io.flutter.plugins.webviewflutter.WebViewClientFlutterApiImpl.requestLoading(WebViewClientFlutterApiImpl.java:164)
04-27 07:50:01.128: E/AndroidRuntime(21722): at io.flutter.plugins.webviewflutter.WebViewClientHostApiImpl$WebViewClientImpl.shouldOverrideUrlLoading(WebViewClientHostApiImpl.java:88)
04-27 07:50:01.128: E/AndroidRuntime(21722): at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(chromium-TrichromeWebViewGoogle.apk-stable-410410683:16)
04-27 07:50:01.128: E/AndroidRuntime(21722): at android.os.MessageQueue.nativePollOnce(Native Method)
04-27 07:50:01.128: E/AndroidRuntime(21722): at android.os.MessageQueue.next(MessageQueue.java:335)
04-27 07:50:01.128: E/AndroidRuntime(21722): at android.os.Looper.loop(Looper.java:183)
04-27 07:50:01.128: E/AndroidRuntime(21722): at android.app.ActivityThread.main(ActivityThread.java:7664)
04-27 07:50:01.128: E/AndroidRuntime(21722): at java.lang.reflect.Method.invoke(Native Method)
04-27 07:50:01.128: E/AndroidRuntime(21722): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
04-27 07:50:01.128: E/AndroidRuntime(21722): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
Contributor
There was a problem hiding this comment.
Yes, I remember the old implementation had a PR at some point to fix a null crash with request headers.
stuartmorgan-g
suggested changes
Apr 27, 2022
| .setRequestHeaders( | ||
| request.getRequestHeaders() != null | ||
| ? request.getRequestHeaders() | ||
| : new HashMap<>()); |
Contributor
There was a problem hiding this comment.
Yes, I remember the old implementation had a PR at some point to fix a null crash with request headers.
| late bool isRedirect; | ||
| late bool hasGesture; | ||
| late String method; | ||
| late Map<String?, String?> requestHeaders; |
Contributor
There was a problem hiding this comment.
Can't we do a body-less constructor using this. references for the arguments, instead of everything being late?
Contributor
Author
There was a problem hiding this comment.
Yea both formats are supported. I chose this one because it was less redundant (except for the late keyword). I'm fine with either, though.
packages/webview_flutter/webview_flutter_android/pigeons/android_webview.dart
Outdated
Show resolved
Hide resolved
stuartmorgan-g
approved these changes
Apr 28, 2022
| class WebResourceErrorData { | ||
| int? errorCode; | ||
| String? description; | ||
| WebResourceErrorData(this.errorCode, this.description); |
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 29, 2022
CaseyHillers
pushed a commit
to flutter/flutter
that referenced
this pull request
Apr 29, 2022
* c09ef582e [flutter_plugin_tools] Remove UWP (flutter/plugins#5432) * 3876f54bf [ci.yaml] Remove explicit caches (flutter/plugins#5434) * 0605d876d [webview_flutter_android] Updates `pigeon` version to support null safety (flutter/plugins#5395) * 4b687c9fa [video_player] Fix XCUITest based on the new tooltip accessibility label (flutter/plugins#5426) * e777e515b Roll Flutter from 1b58a59 to 4cea9af (147 revisions) (flutter/plugins#5437) * 656e8c443 Roll Flutter from 4cea9af to 5b71314 (4 revisions) (flutter/plugins#5441) * f689280bf [flutter_plugin_tools] Validate code blocks in readme-check (flutter/plugins#5436) * 9c41c6895 Roll Flutter from 5b71314 to 7a74222 (1 revision) (flutter/plugins#5442) * 160c714e7 Roll Flutter from 7a74222 to 2eed8cb (1 revision) (flutter/plugins#5443)
egramond
pushed a commit
to egramond/flutter
that referenced
this pull request
May 5, 2022
…#102824) * c09ef582e [flutter_plugin_tools] Remove UWP (flutter/plugins#5432) * 3876f54bf [ci.yaml] Remove explicit caches (flutter/plugins#5434) * 0605d876d [webview_flutter_android] Updates `pigeon` version to support null safety (flutter/plugins#5395) * 4b687c9fa [video_player] Fix XCUITest based on the new tooltip accessibility label (flutter/plugins#5426) * e777e515b Roll Flutter from 1b58a59 to 4cea9af (147 revisions) (flutter/plugins#5437) * 656e8c443 Roll Flutter from 4cea9af to 5b71314 (4 revisions) (flutter/plugins#5441) * f689280bf [flutter_plugin_tools] Validate code blocks in readme-check (flutter/plugins#5436) * 9c41c6895 Roll Flutter from 5b71314 to 7a74222 (1 revision) (flutter/plugins#5442) * 160c714e7 Roll Flutter from 7a74222 to 2eed8cb (1 revision) (flutter/plugins#5443)
mauricioluz
pushed a commit
to mauricioluz/plugins
that referenced
this pull request
Jan 26, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updates pigeon api to use null safety since flutter/flutter#59118 has added support for nullable parameters.
Also updates the pigeon file to include the output files. This removes the need for the
.generatePigeons.shscript.No version change:
Only updates the
pigeonapi implementations.Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.