For example, In Android Studio, if we do pug get on pubspec.yaml
Command flutter pub upgrade
is running as dart pub upgrade
and also test cases are running as dart tests instead of flutter test.
For example, In Android Studio, if we do pug get on pubspec.yaml
Command flutter pub upgrade
is running as dart pub upgrade
and also test cases are running as dart tests instead of flutter test.
2
Answers
The issue was in the
pubspec.yaml
file. I had referenced a commit in one of my packages, but there was a leading space before the commit ID. After removing the space and reformatting thepubspec.yaml
file, the problem was resolved.If the
pubspec.yaml
file is not correctly configured, Flutter might default to using Dart commands.Just an observation.
Flutter command-line tool
Dart command-line tool
It probably depends on how its core compiler treats your commands since the two between Dart and Flutter communicate with each other (primarily because Dart is solely provided for Flutter, or vice versa). but, I am not sure of your statement about,
Because of why you said that, I mean, how did you verify it by yourself?
For me, recently, during the time before I did an update to Flutter 3.24.5 with a default Dart version. I’d tried a Flutter command, but I forgot what the command was. It then suggests using dart instead of flutter as its command tool.
I hope somebody can validate what really is this because I forgot it already.
I only remember a part of it because of this,
When I use a command using flutter, it suggests that I use the dart command instead. This means that the compiler knows what I was doing because instead of firing an exception for my misuse of the command, it suggests what I should use. If I still explained it unclearly, you may visit the link from the header I provided at the very top of my post.
UPDATE:
I am pretty sure that the interaction of the Flutter/Dart compiler towards the command stays the same even on the recent version of it. Most possibly because of its distinctive characteristics such as adaptability and compactness (rich in something you’d expected or unexpected)
Anyways,
I hope it helps!