06.android资源配置
android - app - src - main - AndroidManifest.xml - android:label

1
与 iOS 不同,安卓应用的图片资源不是按 1x 2x 3x 来区分的。
android - app - src - main - res
哦们可以看到以下目录:

2
- mipmap-mdpi
- 相当于 1x
- mipmap-hdpi
- 相当于 1.5x
- mipmap-xhdpi
- 相当于 2x
- mipmap-xxhdpi
- 相当于 3x
- mipmap-xxxhdpi
- 相当于 4x

3

4
注意: 命名不能驼峰,用下划线

5
修改 pubspec.yaml 文件
# To add assets to your application, add an assets section, like this:
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
注意:这里格式需要严格对齐
错误:

6
正确:

7
这里写入文件夹路径或者文件路径都可以
Image(image: AssetImage('路径/xxxxxx.png'))
Last modified 1yr ago