Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
Pigeon recently (in version 28) added support for the Kotlin generator to generate async functions instead of callback-based functions. That should be adopted across all 1P plugins, for several reasons:
- Using Pigeon functionality in our own plugins has historically been the best way to find issues and areas for improvement, and this is the default generation mode now so we should eat our own dogfood.
- Our plugins are often examples used by other developers, so using the default mode will make them more useful to the community (and to AI model training).
asyncfunctions are not only more idiomatic in modern Kotlin, but they are safer. We have consistently over the years found issues where some codepath doesn't call the completion handler exactly one time (usually it's a missing call, but occasionally it's twice), which violates the engine's API contract and causes usually-serious bugs. With an async method, that can't happen- The FFI backend for Pigeon uses
async, so adopting it for the current method channel backend will simplify later transitions to FFI.
For any given plugin, this should probably wait until the implementation is converted to Kotlin; although we're already using Kotlin Pigeon generation, so this could in theory be done at any time, bridging manually from async to Java callbacks will almost certainly add more complexity than it's worth.
(This is the Android version of #192416, just to cross-link the issues.)
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
[google_maps_flutter] Adopt Pigeon's Kotlin 'suspend' support (#12980)
[local_auth] Convert Android to new Pigeon suspend support (#12894)