How to rename flutter project

To rename a Flutter project, you need to follow the below steps:

  1. Close the project in your IDE (such as VS Code or Android Studio).
  2. Go to the root directory of the project in your file explorer.
  3. Rename the main project folder to the desired name.
  4. Open the renamed project folder.
  5. Open the pubspec.yaml file.
  6. Change the name field to the desired name. Make sure to use lowercase letters, numbers, and underscores only, and no spaces.
  7. Save the pubspec.yaml file.
  8. Reopen the project in your IDE.
  9. Run flutter pub get command in the terminal to update dependencies.
  10. Congratulations! Your Flutter project is now renamed.

Here’s an example:

  1. You have a Flutter project called my_flutter_app.
  2. You want to rename it to awesome_app.
  3. Close the project in your IDE.
  4. Rename the my_flutter_app folder to awesome_app.
  5. Open the awesome_app folder.
  6. Open the pubspec.yaml file.
  7. Change the name field to awesome_app.
  8. Save the pubspec.yaml file.
  9. Reopen the project in your IDE.
  10. Run flutter pub get command in the terminal.
  11. Done! Your project is now renamed to awesome_app.

Leave a comment