DEV Community

Cover image for Create a Flutter project for specific platforms in VS Code
Faisal Jan
Faisal Jan

Posted on

1

Create a Flutter project for specific platforms in VS Code

Undoubtedly, Flutter is a great choice for developing cross-platform applications. It supports app development for Android, iOS, macOS, Windows, Linux, and Web. Creating a Flutter project with flutter create generates a project with support for all these platforms, which is not always intended.

Flutter project for all platforms

Especially when you want to build for just one or two platforms. For instance, many times I only want to create a mobile app for Android that I can use myself (or maybe I can't deploy it on the iOS App Store because of $100 a year 😁).

Subsequently, I would want a clean project structure with only the android folder or one that I want. But, there is no way to do that in my favorite IDE, VS Code. I know, I can delete those folders after its initialization. What if I could avoid adding them at the start?

Thankfully, after Flutter 3, we can now use the following command to generate for specific platforms, such as Android, iOS, or even both.

flutter create [project_name] --platforms=android,ios
Enter fullscreen mode Exit fullscreen mode

This way, you can make a project with particular platform support. However, if you are like me and addicted to Command Palette and don't like writing them in the terminal, you can install the Flutter Platforms Customizer extension to achieve this task.

flutter new project with choosing platforms

Now, whenever you type Ctrl+Shift+P and search for Flutter: New project, you will get a new command for choosing platforms. You need to select only those platforms you want to develop your project for.

That's all in this guide. If you still experience issues with any task, please feel free to let me know. I will do my best to respond as quickly as possible. Thank you for your time, and have a great day.

I ❤️ building dashboards for my customers

I ❤️ building dashboards for my customers

Said nobody, ever. Embeddable's dashboard toolkit is built to save dev time. It loads fast, looks native and doesn't suck like an embedded BI tool.

Get early access

Top comments (0)

Gen AI apps are built with MongoDB Atlas

Gen AI apps are built with MongoDB Atlas

MongoDB Atlas is the developer-friendly database for building, scaling, and running gen AI & LLM apps—no separate vector DB needed. Enjoy native vector search, 115+ regions, and flexible document modeling. Build AI faster, all in one place.

Start Free

👋 Kindness is contagious

Explore this insightful write-up embraced by the inclusive DEV Community. Tech enthusiasts of all skill levels can contribute insights and expand our shared knowledge.

Spreading a simple "thank you" uplifts creators—let them know your thoughts in the discussion below!

At DEV, collaborative learning fuels growth and forges stronger connections. If this piece resonated with you, a brief note of thanks goes a long way.

Okay