flutter_workspaces_cli 1.1.2
flutter_workspaces_cli: ^1.1.2 copied to clipboard
A command-line tool for scaffolding and managing monorepo-style Flutter workspace structures.
Flutter Workspaces CLI Example #
This example demonstrates how to use the flutter_workspaces_cli to scaffold a new monorepo project.
1. Installation #
First, install the CLI globally using Dart:
dart pub global activate flutter_workspaces_cli
2. Create a Workspace #
Run the CLI with the --name argument to generate your workspace. For this example, we'll create a project named my_demo_app.
flutter_workspaces_cli --name my_demo_app
3. Resulting Structure #
The command creates a folder named my_demo_app_workspaces with the following structure:
my_demo_app_workspaces/
├── pubspec.yaml # Root workspace pubspec
├── analysis_options.yaml # Root workspace analysis options
├── my_demo_app/ # Main Flutter application
│ ├── lib/
│ │ └── main.dart # Main entry point (imports core)
│ ├── pubspec.yaml
└── packages/
└── core/ # Shared core package
├── lib/
│ └── core.dart
└── pubspec.yaml
4. Running the Project #
Navigate to the new workspace and run the app:
cd my_demo_app_workspaces
flutter pub get
cd my_demo_app
flutter run