Skip to content

Commit

Permalink
feat: add getLatestInstalledSdk method
Browse files Browse the repository at this point in the history
  • Loading branch information
blendthink committed Mar 17, 2024
1 parent 58c5936 commit b4ba886
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/src/features/sdk/services/sdk_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ final class SdkService {
return versions;
}

Future<SdkVersion> getLatestInstalledSdk({
required SdkChannel channel,
}) async {
final versions = await getInstalledSdks(channel: channel);
if (versions.isEmpty) {
throw Exception('Could not find installed Dart SDK');
}
return versions.last;
}

bool exitsSdk({
required SdkVersion version,
}) {
Expand Down

0 comments on commit b4ba886

Please sign in to comment.