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.
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
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.
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.
Top comments (0)