Skip to content

Concerns Regarding the Removal of --dart-define-from-file Feature #138793

@blendthink

Description

@blendthink

Is there an existing issue for this?

Use case

I'm writing to express my concerns regarding a recent change introduced in the following pull request: #136865 . This update seems to have altered the behavior of the --dart-define-from-file feature, preventing entries specified in the file from being written into Gradle configuration values or environment variables during the build process.

As outlined in this article (https://zenn.dev/altiveinc/articles/separating-environments-in-flutter), many projects relying on --dart-define-from-file for environment separation now face the necessity of revising their processes. While I understand that Flutter's official documentation (https://docs.flutter.dev/deployment/flavors) recommends setting environments separately for iOS and Android, this approach can significantly increase the number of files and configurations, leading to higher costs.

Although solutions like the Flutter Flavorizr package (https://pub.dev/packages/flutter_flavorizr) can reduce these costs, they often obfuscate various processes, potentially complicating maintenance. The introduction of --dart-define-from-file was a response to a community need, as seen in this issue: #107810 , and its implementation was intended to directly utilize project variables in Android's build.gradle and environment variables in iOS.

Proposal

In light of the current situation, I believe it would be more appropriate to document the --dart-define-from-file feature rather than removing it. Even if it was introduced unintentionally, considering that it has been added and potentially utilized by many users, it would be prudent to provide some form of alternative solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listteam-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