Sagar Pal
Sagar Pal

Reputation: 1

I am not able to use other packages in dependencies in flutter

I have just started using flutter and I am using flutter packages like material.dart , cupertino.dart but when it come to use other packages like image_picker, english_words, I am not able to use it and I had declared packages with versions in dependencies in pubsec.yaml file. After when I write the import package name in the main file it shows a red line under it and the folder was also not created on the left side.

Upvotes: 0

Views: 496

Answers (1)

Harshvardhan Joshi
Harshvardhan Joshi

Reputation: 3193

It seems the packages that were declared as dependencies in pubspec.yaml files are not yet downloaded.

Try running: flutter packages get from your project's root directory.

Sometimes it doesn't work even after the above command is executed, in such case close current project and reopen it.

Upvotes: 1

Related Questions