Create Flutter Monorepo Workspace
Monorepo gives you ability to manage (apps with common packages) independently within the same repository.xflutter_cli create --template=workspace
dart pub global activate melos
(core) packages contains all shared components you want to share between apps
Create App inside workspace:
to create another application inside workspace, run create app command in workspace root directory:xflutter_cli create
Create Package inside workspace:
to create another package inside workspace, run create package command in workspace root directory:xflutter_cli create --template=package
Result:
- flutter_monorepo_workspace
- apps
- customer_app
- android
- assets
- ios
- lib
- common
- packages
- core
- lib
- src
- data
- di
- environments
- events
- extensions
- storage
- ui
- utilities
- viewmodels
Usage:
Name | Type | Description | Allowed Values | Format |
---|---|---|---|---|
name | option | workspace name | - | snack case |
package | option | first application package name | - | snack case |
architecture | option | specify first application architecture | layers, modules | |
default-values | flag | initialize with default values like colors | - |