Repository navigation
[local_auth] Convert implementation to Kotlin - #12635
auto-submit[bot] merged 12 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request converts the Android implementation of the local_auth plugin from Java to Kotlin, updating AuthenticationHelper and LocalAuthPlugin alongside their unit tests, and increments the package version to 2.1.0. The review feedback recommends assigning the newly created BiometricPrompt in handleResume to the biometricPrompt member variable to ensure it can be cancelled, and suggests removing redundant empty overrides of DefaultLifecycleObserver methods.
| override fun onDestroy(owner: LifecycleOwner) {} | ||
|
|
||
| override fun onStop(owner: LifecycleOwner) {} | ||
|
|
||
| override fun onStart(owner: LifecycleOwner) {} | ||
|
|
||
| override fun onCreate(owner: LifecycleOwner) {} |
There was a problem hiding this comment.
These empty overrides of DefaultLifecycleObserver methods are redundant because DefaultLifecycleObserver provides default no-op implementations for all of its methods. Removing them simplifies the class and improves maintainability.
References
- Avoid redundant overrides of interface methods that already have default no-op implementations to keep the codebase clean and maintainable.
There was a problem hiding this comment.
This was in the Java code, but since it's obviously a no-op to remove these I went ahead and did that.
| helper.onAuthenticationError(BiometricPrompt.ERROR_USER_CANCELED, ""); | ||
|
|
||
| verify(handler).complete(new AuthResult(AuthResultCode.USER_CANCELED, "")); | ||
| assertNotNull(result[0]); |
There was a problem hiding this comment.
This no longer checks this was called only once.
If you make result a ArrayList<> and use result.add(authResult), you could check the size is only 1.
…r#192876) flutter/packages@bebbb57...c2b58e1 2026-09-15 stuartmorgan@google.com [local_auth] Convert implementation to Kotlin (flutter/packages#12635) 2026-09-15 mhmmd.bayraktar@gmail.com [pigeon] Treat NSNull as null for non-null Flutter API returns (flutter/packages#12531) 2026-09-15 daniel.leon@cloudsufi.com [espresso] Adopt code-excerpts for README (flutter/packages#12644) 2026-09-15 daniel.leon@cloudsufi.com [pointer_interceptor] Adopt code-excerpts for README (flutter/packages#12641) 2026-09-15 47866232+chunhtai@users.noreply.github.com [ci] Checks unmerged batch release sync back before next release (flutter/packages#12868) 2026-09-15 puneetkukreja98@gmail.com [material_ui] Add sortIconBuilder to DataTable, PaginatedDataTable, and DataTableThemeData (flutter/packages#12645) 2026-09-15 10687576+bparrishMines@users.noreply.github.com [cross_file_platform_interface] Platform interface implementation of `cross_file` (flutter/packages#12825) 2026-09-15 10687576+bparrishMines@users.noreply.github.com [cross_file] Move cross_file into a federated cross_file directory (flutter/packages#12869) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Following up from #12635, this converts the unit tests from Java to Kotlin. As with that PR, this started with a deterministic Android Studio conversion, then made follow-up fixes manually, including suggestions from a local Gemini review. The non-test changes are to replace `@VisibleForTesting` with `internal` now that the tests are Kotlin and can therefore access `internal` members. (Also, one very minor refactoring to fix a code suggestion warning in Android Studio.) Part of flutter/flutter#188630 ## Pre-Review Checklist [^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.
Converts the implementation of the plugin to Kotlin, so that it can be used to dogfood the new async/await support in Pigeon 28 (not added in this PR; this is just to unblock adding that in a later PR).
The process was as described here:
Tests will be converted in a follow-up PR, so that we aren't making massive changes to implementation and tests in the same PR, since it's intended to be behavior-neutral.
Part of flutter/flutter#188630
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