How to Create an Empty Flutter Project Without the Counter App Boilerplate Code
Starting a new Flutter project is an essential part of any Flutter developer’s life. Usually, when we create a new project by running the “flutter create app_name” command or start a brand new project from Android Studio, we end up with a boilerplate code for a counter app like this:
Running this project you will get this:
So, the question is, how can we create an empty Flutter project? In this article, you will learn two ways to start an empty Flutter project without the boilerplate code from the counter app.
Before we get started, make sure you have already installed the Flutter SDK so we can smoothly proceed with the project. If you haven’t installed it yet, see the “Get Started with Flutter” guide on the official website
Let’s get started
Open VSCode or Android Studio terminal, or use your Mac terminal or Windows command line.
- Navigate to the desired location:
2. After navigating to the desired location, run this command:
flutter create -e your_app_name
That’s it! Your new empty Flutter project will be created at the desired location.
To target a specific platform and keep your new Flutter project clean of any boilerplate code, run this command:
flutter create -e your_app_name --platforms android,ios
To specify the organization name, you can also run this:
flutter create -e your_app_name --platforms android,ios --org “com.your_organization”
With this command, you will have a new empty Flutter project without the boilerplate counter app code.
Using Visual Studio Code
- Open VSCode, click “View” located at the top, and select “Command Palette”
2. Search for “Flutter” and select: “Flutter New Project”
3. Select the project template “Application (empty)”
4. Choose the folder location
5. Enter a project name
6. Click Enter
Running the project
Your new empty Flutter project without the counter app’s boilerplate code will be created at your desired location with the given name.
Congratulations! With this comprehensive guide, you now have all the tools to kickstart your Flutter journey and create new empty Flutter projects effortlessly. You’ve learned how to navigate the process of creating empty Flutter projects, avoiding the boilerplate code that comes with a counter app.
I hope you enjoyed this article and found it valuable in your Flutter development endeavors. If you’d like to stay updated with more insightful articles like this, feel free to follow me. I’m excited to share more tips, tricks, and in-depth tutorials to help you become a proficient Flutter developer.
Remember, practice makes perfect, so keep exploring and building amazing apps with Flutter. Happy coding!