[英]How to change the background of the flutter app default icon?
I have an app and its default icon is a flutter default icon.我有一个应用程序,它的默认图标是 flutter 默认图标。 Its background is white.
它的背景是白色的。
However, when i use the app the background of this icon changes to blue.但是,当我使用该应用程序时,此图标的背景变为蓝色。
I believe it is a default color for flutter apps.我相信它是 flutter 应用程序的默认颜色。
How can I change it to green, for example?例如,如何将其更改为绿色?
That's a part of your accent color so you need to add primaryColor
in your MaterialApp()
widget这是您的强调色的一部分,因此您需要在
MaterialApp()
小部件中添加primaryColor
for example例如
MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.lightGreen,//here it goes try changing this to your preferred colour
accentColor: Colors.green.shade800,
),
home: StartScreen(),
routes: {
'/home': (context) => Home(),
},
)
If you want to change your background or fit your icon then head over to (android/app/src/main/res) and right click and go to new/Image Asset
then android studio opens an image asset configuration box there you have to change the path and customize it whatever you want your icon to be.如果你想改变你的背景或适合你的图标然后转到(android/app/src/main/res)并右键单击和 go 到
new/Image Asset
然后 android studio 打开一个图像资产配置框你必须改变路径并自定义您想要的图标。
or或者
If you want to change the flutter app icon or want to add your custom icon follow these steps:如果您想要更改 flutter 应用程序图标或想要添加您的自定义图标,请按照以下步骤操作:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.