I want to change background icon to #fe6017
.
I use flutter_launcher_icons
, set adaptive_icon_background: "#fe6017"
. But it doesn't work.
I also try to resize image. But it always shrinks and put white
color around my image. Thank you.
Let's first add the package to pubspec. yaml . Then all you need to do is give your icon path as it is shown and that's all. You can give different paths for Android and IOS as well.
In this blog post, let’s see how to change the background color of a screen in Flutter. Making Scaffold widget as the root of your screen will help you to change the background color. Using Scaffold class basic material design layout can be applied.
Create a basic Flutter application, and copy the code of following main.dart into your application’s main.dart. In this application, we are setting the app bar color in Scaffold.
Making Scaffold widget as the root of your screen will help you to change the background color. Using Scaffold class basic material design layout can be applied. It has a property named backgroundColor to change the background color of the Scaffold widget. Following is a Flutter example where the background color of the screen is defined.
Flutter SDK is an open-source software development kit for building beautiful UI which is natively compiled. When we create a Flutter Project, it comes with the default Flutter icon.
Open android
folder in Android Studio.
Right-click the res folder and select New > Image Asset.
In the Icon Type field, select Launcher Icons (Adaptive & Legacy).
In the Foreground Layer tab, select an Asset Type, and then specify the asset in the field underneath:
Name - If you don't want to use the default name, type a new name. If that resource name already exists in the project, as indicated by an error at the bottom of the wizard, it's overwritten. The name can contain lowercase characters, underscores, and digits only.
Trim - To adjust the margin between the icon graphic and border in the source asset, select Yes. This operation removes transparent space, while preserving the aspect ratio. To leave the source asset unchanged, select No.
Color - To change the color for a Clip Art or Text icon, click the field. In the Select Color dialog, specify a color and then click Choose. The new value appears in the field.
Resize - Use the slider to specify a scaling factor in percent to resize an Image, Clip Art, or Text icon. This control is disabled for the background layer when you specify a Color asset type. Click Next.
You can create an image filled with color #fe6017 and use it for adaptive_icon_background as in example
flutter_icons:
android: "launcher_icon"
ios: false
image_path: "assets/icon/icon.png"
adaptive_icon_background: "assets/icon/icon-background.png"
adaptive_icon_foreground: "assets/icon/icon.png"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With