Proposal: flutter config
flags can be read from FlutterVersion.flags
#167668
Labels
c: proposal
A detailed proposal for a change to Flutter
fyi-framework
For the attention of Framework team
team-tool
Owned by Flutter Tool team
In the
main
(and I believe,beta
) channels of Flutter,FlutterVersion
exists and is provided various primitive values from.fromEnvironment
flags passed by the tool. For example,FlutterVersion.channel
comes fromString.fromEnvironment('FLUTTER_CHANNEL')
:flutter/packages/flutter/lib/src/services/flutter_version.dart
Lines 22 to 24 in b73450f
flutter/packages/flutter_tools/lib/src/runner/flutter_command.dart
Lines 1492 to 1499 in b73450f
This proposal would add an additional field or field(s - perhaps one for "enabled" and one for "disabled", for example, if we didn't want to say, pass a JSON-encoded string),
$flutterFeatureFlags=${...}
, in order to expose the following within the Flutter runtime:This map could be used:
@loic-sharma has some legitimate follow-up requests that we are careful about the use of
FlutterVersion.flags
in the framework code, and instead might want to lint for it, and provide a typed API that translates, which seems reasonable:... but I'll leave out the specifics for now.
See also: #167667
/cc @ueman @bkonyi @loic-sharma @jtmcdole @camsim99
The text was updated successfully, but these errors were encountered: