Change App/Repo and package name - Flutter Template

Hi all!

I’m struggling with a very “stupid” question. I’m trying to change the default app name that will be used to create the Flutter template of a new App.

Since I want to publish the repo in Github too, I prefer to remove “myapp” by changing with something else because when I’m uploading the repo to Github, even if I change everywhere “myapp” with “somethingelse” the repo will still be named “myapp”.

I’ve tried even by implementing the dev-dependency change_app_package_name (beucase I wanted to change /example with my developer name) as mentioned in a thread somewhere but it didn’t help.

After this I’ve tried to change the dev.nix settings and then rebuild the environment but I still see “myapp” in the top-left corner of the explorer… What am I missing?

Could you please help me?

Thanks in advance guys!

Best regards,
Simone

Renaming and Reconfiguring

  1. Emptying MyApp’s Contents:
  • Action:
    • Navigate to the MyApp directory in your terminal.
    • Execute: rm -rf ./* .??*
  • Clarification:
    • This command removes all files and subdirectories within the MyApp directory, including hidden files. The MyApp directory itself remains.
  1. Creating the New Flutter Project:
  • Action:
    • While still in the MyApp directory, execute: flutter create my_new_app (or replace my_new_app with your desired project name).
  • Result:
    • A new Flutter project, contained within a directory named my_new_app, is created inside the MyApp directory.
  1. Updating dev.nix’s cwd:
 android = {
          cwd = "/home/user/myapp/my_new_app";
          command = ...whatever........

also do change the working directory in

 onCreate = { 
# Hope you can do it easily

just by using cd

1 Like

Thank you for your answer! I’ll give it a try soon and I’ll be back in this thread with the result!

myapp would just be the name of the flutter package and after you rename it you could also delete the android and web folder and recreate with the command line:

flutter create --project-name="my_new_name" .