使用插件 flutter_launcher_icons
在 pubspec.yaml 配置文件中 加入 dev_dependencies
dev_dependencies:
flutter_launcher_icons: "^0.13.1"
准备好app得 icon 图标 其中icon的名字为icon.png
创建assets文件夹 和子文件夹icon iamge 配置静态资源路径
完整配置如下
XML
dev_dependencies:
flutter_launcher_icons: "^0.13.1"
flutter_launcher_icons:
android: "launcher_icon"
ios: true
image_path: "assets/icon/icon.png"
min_sdk_android: 21 # android min sdk min:16, default 21
assets:
- assets/icon/
- assets/image/
flutter clean 清理后 重新安装依赖
重要得一步 执行下面得命令 才会生效
flutter pub run flutter_launcher_icons