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:
- Open the
AndroidManifest.xmlfile. - Locate the
<application>tag. - Modify the
android:labelattribute 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:
- Open the
Info.plistfile. - Locate the
CFBundleNameandCFBundleDisplayNamekeys. - 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.