Skip to content

Commit 63f49df

Browse files
authored
Suggest a solution when Flutter isn't available (#1720)
Closes #1719
1 parent 9e216e0 commit 63f49df

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/src/source/sdk.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ class BoundSdkSource extends BoundSource {
9595
/// contain the package.
9696
String _verifiedPackagePath(String name) {
9797
if (!flutter.isAvailable) {
98-
throw new PackageNotFoundException('The Flutter SDK is not available.');
98+
throw new PackageNotFoundException("The Flutter SDK is not available.\n"
99+
"Flutter users should run `flutter packages get` instead of `pub "
100+
"get`.");
99101
}
100102

101103
var path = flutter.packagePath(name);

test/sdk_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ main() {
9696
}).create();
9797
await pubCommand(command,
9898
error: 'The Flutter SDK is not available.\n'
99+
'Flutter users should run `flutter packages get` instead of '
100+
'`pub get`.\n'
99101
'Depended on by:\n'
100102
'- myapp',
101103
exitCode: exit_codes.UNAVAILABLE);

0 commit comments

Comments
 (0)