Skip to content

[pigeon] Add support for sharing constants across platforms #188642

Closed as duplicate
flutter/packages
#12032

Description

@andywolff

Use case

Pigeon is great for generating type-safe enums and model classes, but when I tried using it, I found I wanted to also put constants in my pigeons to be shared with native code.

Example use case:
For android_hardware_smoke_test (root issue #182123 ), I have a suite of integration tests which I want to run as both flutter driver tests in dart, and as Android Instrumented tests in kotlin. There are a few strings and test timeout constants which I would like to share between the dart and kotlin test scripts.

Proposal

It would be nice if I could define constants in my pigeons/messages.dart file and have them appear in the files generated by pub run pigeon.

Activity

  1. andywolff commented on Jun 26, 2026

    @andywolff
    ContributorAuthor
  2. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    c: proposalA detailed proposal for a change to Flutter
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    and removed
    in triagePresently being triaged by the triage team
    on Jun 29, 2026
  3. added
    P2Important issues not at the top of the work list
    on Jun 30, 2026
  4. github-actions commented on Jul 14, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Jul 14, 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 listc: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions