MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / findFlutterSdk

Method findFlutterSdk

src/extension/sdk/utils.ts:634–645  ·  view source on GitHub ↗
(folders: string[])

Source from the content-addressed store, hash-verified

632 }
633
634 private findFlutterSdk(folders: string[]): SdkSearchResults {
635 return this.searchPaths(
636 folders,
637 executableNames.flutter,
638 // Also check for some additional files so we won't detect `/usr/bin/flutter` as a Flutter SDK at `/usr`.
639 (p) => this.containsFile(p, flutterPath) && (
640 this.containsFile(p, "analysis_options.yaml")
641 || this.containsFile(p, "bin/flutter.bat") // Exists on non-Windows clones of Git and is an obvious sign of the SDK.
642 || this.containsFile(p, "bin/internal/engine.version")
643 ),
644 );
645 }
646
647 private containsFile(folder: string, filePath: string): boolean {
648 const fullPath = path.join(folder, filePath);

Callers 2

scanWorkspaceMethod · 0.95

Calls 2

searchPathsMethod · 0.95
containsFileMethod · 0.95

Tested by

no test coverage detected