Flutter how to manually install packages

大憨熊 提交于 2020-05-28 04:42:36

问题


Is there no way to manually download a package and install it? It's so frustrating using their package manager which this time downloads in 0.4 seconds but the next cannot download ever after multiple tries waiting several minutes each time. It's just so unreliable.

Is there at least a way I can see a progress bar on it or something? It just seems ridiculous to have so much trouble downloading something that I could download in 2 seconds in my browser and it would be successful every single time.

I've wasted half the day just trying to download a package so I can continue with my project because of this. It's just rflutter_alert...I mean how big can it really be?


回答1:


To extend from the other answer, the complete procedure is to download the packages from github and on Mac, to place them in the folder users/*username*/Developer/flutter/.pub-cache/hosted/pub.dartlang.org/. For windows I'm unaware of the location of these packages.

You will also need to change the name from rflutter_alert-master to rflutter_alert-1.0.3 and add the correct version number in.

From there if you run flutter pub get it will successfully complete no problem because there is nothing to download.




回答2:


You could, in theory, download the packages from GitHub and then use them locally. However, this is not recommended, as you won't get any updates. Did you check if there might be another reason for this? I never had issues like this.



来源:https://stackoverflow.com/questions/57491352/flutter-how-to-manually-install-packages

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!