skip to Main Content

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


  1. Chosen as BEST ANSWER

    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 the pubspec.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.

    enter image description here


  2. Flutter command-line tool

    The flutter command-line tool is how developers (or IDEs on behalf of
    developers) interact with Flutter.

    Dart command-line tool

    dart

    The command-line interface to create, format, analyze, test, document,
    compile, and run Dart code.
    The dart tool (bin/dart) is a command-line interface to the Dart SDK.
    The tool is available no matter how you get the Dart SDK—whether you
    download the Dart SDK explicitly or download only the Flutter SDK.

    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,

    Command flutter pub upgrade is running as dart pub upgrade

    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,

    For Dart related commands, you can use the dart command-line tool.

    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!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search