Flutter Create
The flutter create command is the foundation of every Flutter project.
|
| |
| flutter create <project_name> | New project with default template |
|
| |
| --platforms <platforms> | Specifies which platforms to add |
| e.g web, windows, macos | |
|
| |
| --template <type> | Creates a project based on a specific blueprint |
| e.g package, plugin, module | |
|
| |
| --org <domain> | Sets the unique application ID |
Common Use Cases & Examples
Section titled “Common Use Cases & Examples”1. The Standard App
Section titled “1. The Standard App”This is the command you will use 90% of the time. Always set your --org.
flutter create --org com.yourcompany.yourapp my_app2. Creating a Reusable Dart Package
Section titled “2. Creating a Reusable Dart Package”You want to share pure Dart logic (models, utilities, APIs) across multiple projects.
flutter create --template=package --org com.yourcompany awesome_utils3. Creating a Plugin with Native Code
Section titled “3. Creating a Plugin with Native Code”You need to write custom Kotlin/Swift code to access platform-specific APIs.
flutter create --template=plugin --org com.yourcompany --platforms=android,ios native_bridge4. Creating a Module for Existing Apps
Section titled “4. Creating a Module for Existing Apps”You want to embed a Flutter screen inside your existing native Android/iOS app.
flutter create --template=module --org com.yourcompany flutter_feature_module5. Targeting Specific Platforms
Section titled “5. Targeting Specific Platforms”You are building a desktop-only application and want to avoid mobile/web configs.
flutter create --platforms=windows,macos,linux desktop_appPro Tip: Always run flutter create --help to see the most up-to-date list of flags and options for your current Flutter SDK version. The available --platforms and --template options evolve over time.