How can I import dependencies in flutter web?

1,114

since flutter-web is not still stable and its in technical stage, a simple way for using library in flutter-web which has been working for me is to add the library resources manually. you just need to copy everything inside the lib folder of the library in your own project. in order to access the library's resources go to https://pub.dev/flutter and search for the library you want and then find the library's github repo in the about section.

Share:
1,114
Navid All Gray
Author by

Navid All Gray

Apple Expert , iOS & Android developer

Updated on December 13, 2022

Comments

  • Navid All Gray
    Navid All Gray over 1 year

    I'm setting up a new flutter-web application but I can't add dependencies that I could do in flutter.

    for example I want to add font-awesome-flutter to the project but get this error!

    font_awesome_flutter: 8.5.0

    Because font_awesome_flutter >=8.0.0 depends on flutter any from sdk which is forbidden, font_awesome_flutter >=8.0.0 is forbidden. So, because salema depends on font_awesome_flutter 8.5.0, version solving failed.

  • Navid All Gray
    Navid All Gray over 4 years
    Thanks, 🙏 it worked for me. I hope this answer help the flutter-web's community.