简体   繁体   English

flutter 变体使用flutter_flavorizr - 如何自定义应用程序图标(android 和 IOS)?

[英]flutter variant flavors using flutter_flavorizr - how to customize app icon (both android and IOS)?

I am trying to figure out how to use flutter_flavorizr to make different variant apps with the same code based.我试图弄清楚如何使用 flutter_flavorizr 来制作具有相同代码的不同变体应用程序。

Here are some documentations that I have been trying to refer: https://pub.dev/packages/flutter_flavorizr#-readme-tab- https://medium.com/@angeloavv/easily-build-flavors-in-flutter-android-and-ios-with-flutter-flavorizr-d48cbf956e4以下是我一直试图参考的一些文档: https: //pub.dev/packages/flutter_flavorizr#-readme-tab-https://medium.com/@angeloavv/easily-build-flavors-in-flutter- android-and-ios-with-flutter-flavorizr-d48cbf956e4

So far, I cant find much information/example detailing on customizing the app icon for the different apps (essentially its needed for both Android and IOS).到目前为止,我找不到太多关于为不同应用程序自定义应用程序图标的信息/示例详细信息(基本上 Android 和 IOS 都需要它)。

My question is how can I use flutter_flavorizr to customize the appicons for the different variant apps?我的问题是如何使用 flutter_flavorizr 为不同的变体应用程序自定义应用程序图标? Is that possible那可能吗

You can use the package flutter_launcher_icons to generate different icons for different flavors.您可以使用 package flutter_launcher_icons 为不同的风格生成不同的图标。 https://github.com/fluttercommunity/flutter_launcher_icons#flavor-support https://github.com/fluttercommunity/flutter_launcher_icons#flavor-support

Create icons configs with names matching your flavors (replace with the actual flavor name): flutter_launcher_icons-<flavor>.yaml创建名称与您的风味匹配的图标配置(替换为实际风味名称): flutter_launcher_icons-<flavor>.yaml

and then run command: flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml然后运行命令: flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons-${flavor_name}.yaml

@Vit Veres answer is correct, but for android icon, when you run flutter pub run flutter_launcher_icons:main -f <your config file name here> it will override your main res folder. @Vit Veres 的答案是正确的,但是对于 android 图标,当您运行flutter pub run flutter_launcher_icons:main -f <your config file name here>时,它将覆盖您的主res文件夹。

So before running this command, make a copy of this folder, then run the command then, copy res folder into a android\app\src\<flavor_name> and restore the original res folder.所以在运行这个命令之前,复制这个文件夹,然后运行命令,然后将res文件夹复制到android\app\src\<flavor_name>并恢复原始 res 文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有什么方法可以同时为两者(android,ios)创建一个应用程序图标? - Is there any way to create an app icon in a flutter for both(android, ios)? Flutter- 使用带有 android 多口味的 fastlane - Flutter- using fastlane with android multi flavors 如何使用 flutter 在 android 和 IOS 中连续振动手机 - How to continuously vibrate phone in both android and IOS using flutter Flutter android flavors 生成apk - Flutter android flavors generate apk Android如何在产品口味中使用不同的应用程序图标和应用程序名称 - Android how to use different app icon and app name in product flavors PWA 能否嵌入 Flutter 应用程序中,用于 Android 和 iOS? - Can a PWA be embedded in a Flutter app for both Android and iOS? 适用于 android 和 ios(?) - Flutter-developing kiosk app for both android and ios(?) 我可以为 android 和 ios 应用程序使用相同的 Flutter 应用程序吗? - Can I use same flutter app for both android and ios apps? Flutter 应用程序未在 iOS 和 Android 上使用相同版本的 Flutter 和 Dart 的不同 PC/MAC 上运行 - Flutter app is not running on different PC/MAC on both iOS and Android with same version of Flutter and Dart 如何使用flutter将braintree集成到iOS或Android应用程序中? - How to integrate braintree to iOS or Android app using flutter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM