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.

Sentry blog image

Build, Ship, See It All: MCP Monitoring with Sentry

Built an MCP server? Now see everything it does. Sentry’s MCP Server Monitoring tracks every client, tool, and request so you can fix issues fast and build with confidence.

Read more

Top comments (0)

Heroku

Tired of jumping between terminals, dashboards, and code?

Check out this demo showcasing how tools like Cursor can connect to Heroku through the MCP, letting you trigger actions like deployments, scaling, or provisioning—all without leaving your editor.

Learn More

👋 Kindness is contagious

Take a moment to explore this thoughtful article, beloved by the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A heartfelt "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay