"zsh: command not found: pub" while testing my code for exercism - flutter

I want to test my coding exercise for exercism.io. On the Intellij IDEA and Android Studio when I try to type on terminal "$ pub get" and "$ pub run test". I get this error "zsh: command not found: pub or $". I've been stacking here for 2 days. What should I do?
My System: Mac OS Catalina version 10.15.3.
My Android SDK is located: Users/vortovor/Developer/flutter/bin/cache
in cache there is a file named "dart-sdk".

You may want to use the pub shipped with the Flutter version you're using as told on the pub tool section of Dart documentation:
Flutter note: If you’re using the Flutter SDK, don’t use the pub command directly. Instead use the flutter pub command, (...)
flutter pub get
# or
flutter pub test

Related

Visual Studio Code Can't Run Flutter - looking at wrong dart version

I have created a new flutter Project, but when I run it on Visual Studio Code by clicking on "Start Debugging" the following errors pops up:
[button_test] flutter pub get
Running "flutter pub get" in button_test...
The current Dart SDK version is 2.17.6.
Because button_test requires SDK version >=2.18.4 <3.0.0, version solving failed.
pub get failed (1; Because button_test requires SDK version >=2.18.4 <3.0.0, version solving failed.)
exit code 1
So I've double checked the dart version by entering dart --version. But this came back as 2.18.6
The funny thing is that if I enter flutter run on the Terminal, it works no problem. As I've installed the flutter and dart extension, I believe this is a problem with those extension? With that said, is there a way to fix which version of dart it's looking at?
Thanks
Step 1:
Open terminal and Navigate to the flutter location
cd <flutter_path>
Step 2:
Now enter the command
git checkout
You can find all the releases from this link https://docs.flutter.dev/development/tools/sdk/releases
Step 3:
Now run flutter doctor -v command so flutter will download the stuff related to the particular version
flutter doctor -v
Once the flutter doctor command is successful you can go ahead and enjoy the version you wish

how to run "melos bootstrap" command with fvm

Currently on my computer installed Flutter version 3.3, but my project works on 2.5.3
So I'm using fvm for that, I've set up everything, but when I run melos bootstrap, I think it's just running command "flutter pub get" instead of "fvm flutter pub get"
How to fix that?
You can customize the sdkPath so it uses your fvm config like so:
sdkPath: .fvm/flutter_sdk
Link to melos docs: https://melos.invertase.dev/configuration/overview#sdkpath

FirebaseAppPlatform.verifyExtends error while running flutter test

When I run my bitbucket pipeline for my project im getting an error during flutter test:
/root/.pub-cache/hosted/pub.dartlang.org/firebase_core-1.24.0/lib/src/firebase_app.dart:18:25: Error: Member not found: 'FirebaseAppPlatform.verifyExtends'.
FirebaseAppPlatform.verifyExtends(_delegate);
^^^^^^^^^^^^^
When I run flutter test in my terminal I don't have these issues.
My pipeline script is:
Build Setup
flutter clean
flutter pub get
flutter pub run build_runner build
bash <(curl -s https://raw.githubusercontent.com/objectbox/objectbox-dart/main/install.sh)
flutter test
Because there are some breaking change of firebase_core_platform_interface that do not comply with semantic versioning:
https://github.com/firebase/flutterfire/issues/9806
You need to overwrite this library:
Root cause
You are update or installing only a subset of the Firebase plugins (firebase_core, firebase_analytics,...)
Solution
Solution 1: (preferred) Updating to the latest version with flutterfire update check the docs here. But it is not easily because your project will have a lot of packages dependencies to each other like flutter version 2 or 3, so on. Anyway, it is long term solution.
Solution 2: (Fix to run)
You can add to your pubspec.yaml
dependency_overrides:
firebase_core_platform_interface: 4.5.1
Solution 3: (Fix to run)
Update dependencies with this below command line:
flutter pub upgrade --major-versions
Finally, Run the project again by following stuffs:
flutter clean
flutter pub get
cd ios && rm -f Podfile.lock
cd ios && pod install --repo-update
flutter run
That's it!
Run "flutter pub upgrade --major-versions"
run this
flutter pub upgrade --major-versions
than run this
flutter upgrade
I changed my flutter version via flutter channel master. This changed automatically my pubspec.lock.
In my case, restoring previous version of pubspec.lock solved the problem (pug get needed).

pub run build_runner build has error (66)

hey guys i have error after using command : flutter pub run build_runner build
error message :
C:\Users\matin\AndroidStudioProjects\mosito>flutter pub run build_runner build
Could not find a file named "pubspec.yaml" in "C:\Users\matin\Documents\flutter\.pub-cache\hosted\pub.dartlang.org\async-2.8.1".
pub finished with exit code 66
i try flutter pub upgrade and a lot of things from google but problem not fixed
NOTE: im new to flutter i want use this command for making .g.dart file for my models thanks for your attention
I think may be you are not in your project directory. Suppose you have a project name A in myfolder in C drive of your computer. First goto myfolder with terminal. after that try below code to build the project...
flutter packages pub run build_runner build --delete-conflicting-outputs
Turn on Your Terminal and Run
flutter doctor
if it is showing
Could not find "flutter"
Then you need to install flutter Correctly You Can check :
https://docs.flutter.dev/get-started/install/windows

Update Dart DevTools

I'm currently on flutter 1.22.4 with dart devtools on 0.9.3+4, but https://pub.dev/packages/devtools/install has it at 0.9.5. My current version doesn't have the response body in the network tab and I'm trying to update to a newer version and I don't know how to.
First, run flutter -doctor and see if there are any errors. Then try running "flutter pub get" if that doesn't do the trick upgrade your tools and run flutter -clean and try again.