[image_picker] Switch to Kotlin Pigeon#11504
[image_picker] Switch to Kotlin Pigeon#11504stuartmorgan-g wants to merge 9 commits intoflutter:mainfrom
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the internal Pigeon implementation from Java to Kotlin, updating the build configuration and regenerating the messaging layer. The ImagePickerDelegate and ImagePickerPlugin have been refactored to use Kotlin-style callbacks and result handling. Feedback was provided regarding the high verbosity of the new callback type signatures in Java, suggesting the use of wrappers to improve code readability.
| public final @NonNull Function1< | ||
| ? super @NotNull Result<? extends @NotNull List<@NotNull String>>, @NotNull Unit> | ||
| callback; |
There was a problem hiding this comment.
The type signature for the callback is extremely verbose in Java. While this is dictated by the Kotlin Pigeon generator's use of Kotlin's Result type, it significantly impacts readability. Consider if a simpler wrapper or functional interface could be used to encapsulate this complexity in the future.
Replaces the Java Pigeon generator with the Kotlin Pigeon generator, and adjusts the project accordingly:
Part of flutter/flutter#158287
Pre-Review Checklist
[shared_preferences]///).Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2