sdkPath top-level property

String get sdkPath

Throwing getter that locates a Dart SDK root using findSdkPath.

Throws SdkDiscoveryException if no valid Dart SDK can be located.

Implementation

String get sdkPath {
  final path = findSdkPath();
  if (path == null) {
    throw const SdkDiscoveryException(
      'Cannot locate a Dart SDK. Pass --sdk-path, set the DART_SDK environment '
      'variable, or ensure a Dart SDK is on PATH.',
    );
  }
  return path;
}