Having to restart Android Studio everytime I add a new dependency in pubspec.yaml| Flutter

Viewed 165

Whenever I add a new dependency/package in pub spec and run my code is throws out the error:

Compiler message: Error: Could not resolve the package 'circulardropdownmenu'

It works after I restart android studio.

2 Answers

Apparently you have to re-run (build) the app, and then wait a minute or so.

The pub get link that Android Studio offers in the pubspec.yaml file is not enough.

in your terminal try:

flutter pub get
Related