Skip to content

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

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.

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions