Finds the Flutter SDK a project uses.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
find(
String projectRoot, {String? configured, Map< String, String> ? environment, Duration timeout = const Duration(seconds: 20)}) → Future<FlutterSdk?> -
locate, and when that finds nothing, the SDK the first
flutteron thePATHsays it runs (flutterRootfromflutter --version --machine): how a snap's launcher, or a version manager's shim, is found. The launcher getstimeout(a first run can set its SDK up for minutes); then it is stopped, with what it started, and taken as not knowing. Its answer is kept for the rest of this process. -
locate(
String projectRoot, {String? configured, Map< String, String> ? environment}) → FlutterSdk? -
The SDK for
projectRoot, trying in order:configured(a setting), theFLUTTER_ROOTenvironment variable, the SDK that last ran pub (flutterRootin package_config.json), andflutteron thePATHwhere it is a link into an SDK. Null when none is found. It never starts a program; find also asks a launcher outside an SDK (a snap's, a version manager's shim), and locate then reuses its answer. SettingFLUTTER_ROOTto the SDK's folder always works.