Flutter packages get does not install new package

hi I have a similar problem I deleted a package from the dart packages folder and when I run flutter pub run it won't download and work so I tried all the way people said but something worked for me is I tried to repairing pub cache and it worked just run

flutter pub cache repair

so basically run:

flutter clean

flutter packages get

flutter packages upgrade

Restart Android Studio or Visual Studio

you can restart VSC by:

ctrl + shift + P and then a search bar will appear and then type: "restart" and smash the Enter key.


Close and open your editor. Worked for me ;)