This is the 24th day of my participation in the November Gwen Challenge. Check out the event details: The last Gwen Challenge 2021

Here is nut front-end small classroom, if you like, you can follow my public number “nut front-end,” or add my friends, for more wonderful content

In previous installments, I have introduced the installation of Flutter and some simple configuration, as well as running HelloWord

So how do you set your app name and icon

Flutter sets the name of the App and the method of applying the logo icon.

Although knowledge point is simple, but do not know this knowledge point is not good, so still want to record down, share.

Note that the App name and icon of the Flutter Settings App should be set separately for Android and iOS. You can also set the Android and iOS App names and ICONS separately. You can set them differently, but after all, in order to ensure the consistency of an App, you should not do this. Honestly ensure that the information of the Android and iOS apps is consistent.

When a Flutter is created, the generated project name is the default application name and the default application icon. The specific effect of Flutter is as follows:

1. Set the Android application name and icon in Flutter

Here, the application name and icon are introduced together. The details are as follows.

1. First, locate the file where you want to change the application name. There are two ways to open the file.

The first way is to open the project in the VS Code editor and go to the Android directory of the project and find the Android – >app – > SRC – >main – > Androidmanifest.xml file and modify it in the appropriate place.

The second way is to open the Android Studio editor to open the Android file in your project, again in app – > SRC – >main – > Androidmanifest.xml file to modify, as shown below:

(1) The value of the label under application in androidmanifest.xml is the name of the application;

(2) The icon below the application in the Androidmanifest.xml file corresponds to the icon file of the application;

Set the iOS app name and icon in Flutter

1. Since Apple’s icon Settings are a little special, it is recommended that developers directly open the iOS folder of the project through the Xcode editor, and then set the app icon for iOS in the Xcode editor. I don’t have a MAC, but I can give you a way to do it

Open the project in the VS Code editor, go to iOS — >Runner — > info.plist in the iOS directory, and then go to the corresponding key-value pair to set the app name.

(1) The info.plist file contains the corresponding key-value pair containing the App name, which is where the App name is set;

(2) the AppIcon in assets. xcassets corresponds to the place where the AppIcon is set;

The final effect of the app name and icon is as follows:

3. Set the name and icon of the Web application in Flutter

The application name

The title of the index.html

Application icon

Dart has two titles by default. The first is the in-app name and the second is the Activity page title.

Return new MaterialApp (title: 'nutty') HOME: new Scaffold(appBar: new appBar (title: new appBar) New Text(" 内 容 内 容 "),),);Copy the code

Ok, today’s sharing is over here, if you like it, you can like it