sdkPath top-level property
String?
get
sdkPath
The path to the root of the Dart SDK, or null if no SDK could be located.
Probes the host environment across four tiers (memoized on first access):
Platform.resolvedExecutable(active JIT VM runtime)DART_ROOTandDART_SDKenvironment variablesPATHenvironment variable traversal (dereferencing symlinks and checking Flutter cache layouts)FLUTTER_ROOT/bin/cache/dart-sdkfallback
Implementation
String? get sdkPath {
if (Zone.current[environmentOverridesKey] != null) {
return _resolveSdkPath();
}
if (!_sdkPathResolved) {
_cachedSdkPath = _resolveSdkPath();
_sdkPathResolved = true;
}
return _cachedSdkPath;
}