Change project name

Is it possible to change the name of the project project Flutter? With the name of the project, I mean the name that you specify when creating the flutter project flutter create name.

+4
source share
1 answer

It depends on what you are trying to achieve. If you want to change the name of the application that appears in the mobile phone menu along with the application icon, you must change it android:labelin android/app/src/main/AndroidManifest.xml(example code 1) and CFBundleNamein ios/Runner/Info.plist(example code 2).

The last time I did this, it took me years to find out why the name of the application was not changed in the list of running applications on Android. To do this, you also need to change the title of your MaterialApp (Code Example 3).

, . , . " " pubspec.yaml, , .

1:

<application
    android:name="io.flutter.app.FlutterApplication"
    android:label="New Name"
    android:icon="@mipmap/ic_launcher">  

2:

<key>CFBundleName</key>
<string>New Name</string>

3:

return new MaterialApp(
  title: 'New Name'
  ...);
+7

Source: https://habr.com/ru/post/1687324/


All Articles