Open In App

Flutter – Renaming a App

Flutter is a UI kit by Google. Flutter is a widely growing open-source framework, with many libraries getting published daily making android/iOS, web development easy. In this article, we will see the use of the library – “rename“. Although there are other packages also, but this one is the most popular and holds null safety.

While creating a project, you didn’t give it an appropriate name. Now, you want to change its name. There are two options to do it, create a new project, copy all the files inside the new project – it’s a terrible idea, or rename it using a package with just one command- nice idea.



Prerequisite:

Implementation:

Follow the below steps to rename your flutter app:

Step 1: Installation of Dependencies



Dependencies

pub get
pub add rename

This command will add dependency in pubspec.yaml file, resolving all the dependencies as shown below:

Installing dependencies

Step 2: Import the package

pub global run rename --appname "New App Name"
flutter pub global run rename --app "Quote-Generator"

After you run this command in a terminal, you should see something like the below:

Renaming Applications

pub global run rename --appname yourappname --target android

Similarly, for an ios platform,

Change the bundleId:

If you want to change the bundleId, by default it is like “com.example.appname”. Run the below command:

pub global run rename --bundleId com.companyname.newappname

After this, something like the below should be seen on the terminal, it means you have successfully changed the name of bundleId as shown below:

Congratulations!, you just learned a new way to rename the Flutter app and bundleId of your project.

Article Tags :