Skip to content

☂️ Convert 1P Kotlin plugins to Pigeon's async support #192417

Open

Description

@stuartmorgan-g

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).
  • async functions 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.)

Activity

  1. added
    platform-androidAndroid applications specifically
    packageflutter/packages repository. See also p: labels.
    team-androidOwned by Android platform team
    fyi-ecosystemFor the attention of Ecosystem team
    on Sep 8, 2026
  2. added
    P2Important issues not at the top of the work list
    triaged-androidTriaged by Android platform team
    on Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions