Dart documentation says as below.
Flutter note: If you’re using the Flutter SDK, don’t use the pub command directly. Instead use the flutter pub command<