App Scaffold
The app command scaffolds a new Flutter application inside the monorepo workspace. It generates all the boilerplate needed for a fully configured app: Dart source files, Fastlane configuration, launcher icons, splash screens, flavorizr config, and IDE run configurations.
Usage
# Create a new app
dart run monorepo_toolkit app create --name my_app --org com.example
# With a custom domain for bundle identifiers
dart run monorepo_toolkit app create --name my_app --org com.example --domain example.comFlags
| Flag | Abbr | Default | Description |
|---|---|---|---|
--name | -n | required | App name in snake_case (e.g., my_app) |
--org | -o | com.example | Organization identifier (e.g., com.banuacoder) |
--domain | -d | derived from org | Domain for bundle identifiers (e.g., banuacoder.com) |
The app name must be lowercase with underscores only (^[a-z][a-z0-9_]*$).
How it works
The command uses a two-tier strategy:
Mason brick (preferred) -- If the
app_scaffoldMason brick is installed, it uses Mason to generate the app. This produces the most complete output with all Fastlane files, CI configs, and platform-specific setup.Built-in templates (fallback) -- If Mason is not available, the command falls back to built-in Dart templates that generate the core source files.
Generated structure
The scaffolded app is created at apps/<name>/ with:
apps/my_app/
lib/
main.dart # Entry point per flavor
main_development.dart
main_staging.dart
main_production.dart
bootstrap.dart # App initialization
app.dart # Root widget
di/
injector.dart # Dependency injection setup
fastlane/
Fastfile # Build and deploy lanes
Appfile # App metadata
Matchfile # Code signing config
Gemfile # Ruby dependencies
pubspec.yamlPost-scaffolding steps
After the command completes, follow these steps:
# 1. Resolve workspace dependencies
dart pub get
# 2. Generate injectable, auto_route, and other code
melos run build
# 3. Generate platform directories (Android/iOS)
flutter create apps/my_app --org com.example
# 4. Apply flavor configuration
melos run flavor:generate -- --app my_appMason brick installation
To use the Mason-based scaffolding (recommended), install the brick first:
# From mason.yaml (if configured in the workspace)
mason add app_scaffold
# From a git repository
mason add app_scaffold --git-url https://github.com/banua-coder/archipelago
# Globally
mason add -g app_scaffoldIf Mason is not installed at all, install it with:
dart pub global activate mason_cliWhen to use this
Use app create when adding a new host application to the workspace. Common scenarios:
- Adding a second app variant (e.g.,
app_widgetbookalongsidetemplate_app) - Setting up a white-label app for a different brand
- Creating a standalone demo app for a specific feature