官网:https://flutterchina.club/assets-and-images/#%E6%8C%87%E5%AE%9A-assets
根目录新建
调用
leading: CircleAvatar(
child: Image.asset("images/ic_launcher.png"),
)
pubspec.yaml
要配置下
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/ic_launcher.png