I\'ve just setup my Macbook for flutter development,
So I downloaded flutter sdk, and placed it in my Documents. After, I setup my path variable to
I was following the Flutter get started tutorial and VSCode could not find the package for english_words
, despite it showing in pubspeck.lock
and .packages
. Hot reload didn't work.
To make it work, I stopped the instance and re-run it - so I didn't have to restart VSCode.
I was using (goggle location picker (with much more customisation in functions and UI) ) so I copy this package(complete) and using in my app in one folder but since dart code analyser analyses one flutter project so I found that those which are referencing from inside of this package is not working then I copy only lib folder(of google location picker) in my original project folder and voila this worked for me. This solution took me a time of 3 days. I know this is not the question but it might help someone to save 3 days.
This worked for me in Android Studio as well as VS Code. I only had to run these lines in my terminal/command prompt and problem was solved. There was no need to restart any of the IDEs again
Optionally you also run.
Don't forget to save pubspec.yaml before running "flutter pub get". Restarting Visual Studio Code is not enough. That was my solution. Sometimes when you work with intellij you forget that ...
I also had this issue. I had both VS code
and Android studio
installed in my system.
The error was in VS code
.
When i opened the same project on Android studio
, the dependency was not actually added to pubsec.yaml
. I added it there and ran pub.get
.
When I returned to VS Code
and everything was working fine.
So, Try opening it in other editor if you have, or through NotePad
.
Edit:
Opening widget_test.dart
and running it should also solve your issue.
Execute one of the following:
flutter upgrade
flutter pub get
flutter packages get