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.

AWS GenAI LIVE image

How is generative AI increasing efficiency?

Join AWS GenAI LIVE! to find out how gen AI is reshaping productivity, streamlining processes, and driving innovation.

Learn more

Top comments (0)

ACI image

ACI.dev: Fully Open-source AI Agent Tool-Use Infra (Composio Alternative)

100% open-source tool-use platform (backend, dev portal, integration library, SDK/MCP) that connects your AI agents to 600+ tools with multi-tenant auth, granular permissions, and access through direct function calling or a unified MCP server.

Check out our GitHub!

👋 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