-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Closed
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.
Description
Use case
Flutter 1.17 added the ability to define compile-time variables, which is great.
But if you have a lot of variables that you want to use in Flutter application, build
and run
command could become quite long.
Especially if take into account that each compile-time variable definition should start with --dart-define
.
Proposal 1
Allow defining Map of Dart Defines, where keys will be used for --dart-define
key, and values - Platform.environment
keys.
Example
dart_defines:
ENV: FLUTTER_APP_ENV
APP_NAME: FLUTTER_APP_NAME
Which will be equal to
flutter run --dart-define=ENV=$FLUTTER_APP_ENV --dart-define=APP_NAME=$FLUTTER_APP_NAME
Proposal 2
Allow to use .env
as source for --dart-define
key
Example
ENV: SOME_ENV
APP_NAME: SOME_APP_NAME
Which will be equal to
flutter run --dart-define=ENV=SOME_APP_ENV --dart-define=APP_NAME=SOME_APP_NAME
macabeus, hawkinsjb1, hileomsi, DustinJSilk, torinkwok and 33 more
Metadata
Metadata
Assignees
Labels
c: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilitytoolAffects the "flutter" command-line tool. See also t: labels.Affects the "flutter" command-line tool. See also t: labels.