Flutter: 'package get' has not been run; &

2020-07-18 05:20发布

I dowloaded a Flutter sample code for Catalog from git, which showing me a warning,

'package get' has not been run
'Pub get' has not been run

What does it mean? How to solve it? Should I ignore this warnings or Update dependencies as suggested with links in warning?

enter image description here

7条回答
太酷不给撩
2楼-- · 2020-07-18 05:48

Reopen the project if the error does not disappear even after downloading dependences.

查看更多
走好不送
3楼-- · 2020-07-18 05:48
  1. Click Get dependencies and wait for it to finish.
  2. Restart Android Studio
查看更多
我欲成王,谁敢阻挡
4楼-- · 2020-07-18 05:54

Dart is similar to node. It has a pubspec.yaml which is the equivalent of package.json containing your dependencies and stuff.

And you need to download these dependencies, using pub get. Or on the case of flutter, using flutter packages get.

This warning is just here to reminds you that your dependencies aren't downloaded

=> Click on Get Dependencies of the first warning

查看更多
SAY GOODBYE
5楼-- · 2020-07-18 06:00

Just restart Android Studio or Your IDE, it worked for me also. Or Run flutter upgrade in terminal.

查看更多
▲ chillily
6楼-- · 2020-07-18 06:00

Click on the 'Get dependencies' on the banner 'pub get', then the banner will disappear an the dependencies will get downloaded and the errors will disappear. If still the errors remain then restart Android Studio and try. It worked for me.

查看更多
ら.Afraid
7楼-- · 2020-07-18 06:12

Just open the Terminal and run :

flutter upgrade

查看更多
登录 后发表回答