Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

Replaces one-off wrappers with a templated version. While this isn't important in isolation, it sets a better precedent for us to follow for future plugins, and likely for Pigeon generation of helper utils.

The "Unit" forms of the wrappers are still necessary because there's no way (AFAICT) to cause Java to infer the Unit type, since it's not a thing in Java.

I've validated that the type inference on the generic is still enforcing type safety based on the inferred type. I.e., if I try to pass the wrong value type, it won't compile.

Related to flutter/flutter#158287

Pre-Review Checklist

Footnotes

  1. 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 3

Replaces one-off wrappers with a templated version. While this isn't
important in isolation, it sets a better precedent for us to follow for
future plugins, and likely for Pigeon generation of helper utils.
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a good simplification to the Kotlin/Java interoperability helpers. It replaces four specific callback completion functions with a single, more flexible generic function completeWithValue. This change reduces code duplication in ResultUtils.kt and simplifies the native Android implementation. The call sites in GoogleSignInPlugin.java are updated accordingly. The CHANGELOG.md and pubspec.yaml are also updated to reflect this internal improvement.

@stuartmorgan-g
Copy link
Collaborator Author

test-exempt: code refactor with no semantic change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant