【发布时间】:2021-11-24 22:41:50
【问题描述】:
我正在尝试通过资产将图像添加到我的颤振应用程序中。 this is the where i have linked the images. this is the pubspec yaml file 尝试了不同的方法。似乎没有任何效果。
【问题讨论】:
-
您应该使用 Image.asset 小部件,然后作为第一个参数将图像的路径作为字符串。
-
首先将 pubspec -images 中的行更改为 -assets/images 然后运行 pubget 然后你就可以访问图像了
标签: flutter android-studio flutter-dependencies flutter-image flutter-assetimage