-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
Is there an existing issue for this?
- I have searched the existing issues
- I have read the guide to filing a bug
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.