Target of URI doesn't exist 'package:english_words/english_words.dart'

For some packages, once you do all the process described by the other answers to this question, you have to close the Android project and open it again. As well as the emulator.

Some packages need the restart, others do not need it.


After adding the package in the pubspec.yaml file, you need to execute the command flutter packages get or click on "Packages Get" in the action ribbon at the top of pubspec.yaml file.

Then the dependency and any transitive dependency will be added to the .packages file.

Check this:

https://flutter.io/using-packages/


Solution (For VSCode):

  1. Run flutter packages get in pubspec.yml
  2. Restart VSCode

Tags:

Dart

Flutter