乐闻世界logo
搜索文章和话题

How can I change the app display name build with Flutter?

1个答案

1

In Flutter, changing the display name of an application (which appears on the home screen after installation) typically involves modifying native code for different platforms. Since Flutter is a cross-platform framework, you need to adjust settings for both Android and iOS separately. Below, I will detail how to change the display name for both platforms.

1. Android:

For Android, the display name is defined in the AndroidManifest.xml file, typically located in the android/app/src/main directory. Follow these steps to modify it:

  1. Open the AndroidManifest.xml file.
  2. Locate the <application> tag.
  3. Modify the android:label attribute within the <application> tag to set the desired display name. For example:
xml
<application android:label="My New App" ...> ... </application>

2. iOS:

For iOS, the display name is set via the Info.plist file, usually found in the ios/Runner directory. The steps to modify it are:

  1. Open the Info.plist file.
  2. Locate the CFBundleName and CFBundleDisplayName keys.
  3. Change the values of these keys to your desired display name. For example:
xml
<key>CFBundleName</key> <string>My New App</string> <key>CFBundleDisplayName</key> <string>My New App</string>

After making the changes, rebuild and reinstall the app on the device for the modifications to take effect.

Example:

Suppose I have an application called 'Weather Forecast' and I want to change its display name to 'My Weather Assistant'. Following the steps above, I would update the relevant fields in both AndroidManifest.xml and Info.plist to 'My Weather Assistant'.

It's recommended to keep the app name short and descriptive so users can easily identify its purpose. Additionally, for different markets or regions, consider multilingual support by setting the app name in various languages.

2024年8月5日 13:25 回复

你的答案