Skip to content

Read --flavor from Flutter #128046

@AlexV525

Description

@AlexV525

Is there an existing issue for this?

Use case

flavor for tools can be useful to switch between different product variants and correspond to different platform resources and codes. However, the value of flavor can not be read from the Flutter (Dart) side directly. To do so in the current circumstance, we need to write duplicate definitions like flutter run --flavor dev --dart-define=app-flavor=dev to get it available to read at the Flutter side directly.

Proposal

Inject the flavor variable into environments, or provide another ability to read from the Flutter code directly.

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 Flutterteam-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-toolTriaged by Flutter Tool team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions