Flutter 启动器图标-一个包,简化了更新您的 Flutter 应用程序的启动器图标的任务。完全灵活,允许您选择什么平台,您希望更新的启动器图标,如果你想,选项保留您的旧启动器图标,以防您想恢复到未来的某个时候。
pub依赖库地址:flutter_launcher_icons | Dart Package
github仓库地址:https://github.com/fluttercommunity/flutter_launcher_icons/
将 Flutter Launcher 图标配置添加到 pubspec.yaml 中,或者创建一个名为 Flutter _ Launcher _ icon 的新配置文件。Yaml.下面显示了一个示例。在示例项目中可以找到更复杂的示例:
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
web:
generate: true
image_path: "path/to/image.png"
background_color: "#hexcode"
theme_color: "#hexcode"
windows:
generate: true
image_path: "path/to/image.png"
icon_size: 48 # min:48, max:256, default: 48
macos:
generate: true
image_path: "path/to/image.png"
在项目的根目录下面创建一个assets文件夹,将图标文件放进去,然后配置到flutter_launchaer_icons里面:
运行下面的命令:
flutter pub get
flutter pub run flutter_launcher_icons
就会提示你图标已生成:?
?
windows下面已生效:
web也生效了:
其它平台自己测试吧,应该是没有问题的。?