flutterSdk constant

DefineSource const flutterSdk

The root of the Flutter SDK this launch is being built with.

A value flutterware is holding while the app it launches cannot see it. flutter run hands its child a stripped environment, so nothing inside the process can tell which flutter started it — and an app that has to spawn Flutter itself, a dev tool or a codegen harness or this GUI, must not fall back to the one on PATH: that is routinely a different version from the one the project pinned.

Which makes it the same kind of fact as hostAddresses — something the machine knows, the app cannot reach, and no constant can be written down for. The difference is only that there is exactly one answer, so it fills the knob in rather than offering a list.

// main({String flutterSdkRoot = const String.fromEnvironment(…)})
Knob('flutterSdkRoot', from: ValueSource.flutterSdk, required: true),

Pairs naturally with Knob.required: the source answers for every launch flutterware makes, and the flag is what refuses the one where it could not.

Implementation

static const DefineSource flutterSdk = FlutterSdkSource();