flutter添加图片在win和linux上
【环境】
1、win子系统ubuntu18.04
2、ubuntu下flutter版本1.22.4
3、xrdp 远程桌面
1、win10
2、win10下flutter版本1.24.0.10-1.pre
一、win上添加
1、创建图片存放目录
mkdir images
tree -L 1
├── README.md
├── android
├── build
├── has-anmimation-bak-main.dart-txt.txt
├── images
├── ios
├── lib
├── linux
├── pubspec.lock
├── pubspec.yaml
├── test
└── textdisplay.iml
images文件名可以随意设置
2、修改文件pubspec.yaml
# The following section is specific to Flutter.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- images/1.jpg
# - images/a_dot_ham.jpeg