Monorepo Toolkit
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.exampledart run monorepo_toolkit app create --name admin_app --org com.acmeℹ Scaffolding new app: admin_appℹ Organization: com.acmeℹ Domain: acme.comℹ
Flags
| Flag | Abbr | Default | Description |
|---|---|---|---|
--name | -n | required | App name in snake_case (e.g., my_app) |
--org | -o | com.example | Reverse-DNS organization (e.g., com.banuacoder). Its last segment is the brick's organization, the rest its domain, so --org com.banua_coder --name my_app gives Android com.banua_coder.my_app and iOS com.banuacoder.myApp. See App and Bundle IDs |
--domain | -d | derived from org | Shown in the summary only. It does not change the app IDs |
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 or the brick 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 # Production entry point
main_development.dart
main_staging.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
flavorizr.yaml
pubspec.yamlThe Mason brick path also generates launcher icon and splash configs, integration tests and the Android/iOS platform directories (it runs flutter create for you). The built-in fallback only writes Dart source files.
Post-scaffolding steps
The command does not edit flavors.yaml. Add the new app's entry there before you run flavor:generate. The command prints the steps that still apply. Typically:
# 1. Resolve workspace dependencies
dart pub get
# 2. Generate injectable, auto_route, and other code
melos run build
# 3. Only if platform directories are missing (built-in fallback path)
flutter create apps/my_app --org com.example
# 4. Apply flavor configuration
melos run flavor:generate -- --app my_appMason brick availability
To use the Mason-based scaffolding the toolkit needs the mason CLI and the app_scaffold brick registered with Mason. See the app_scaffold brick for how it is obtained. If Mason is not installed, install it with:
dart pub global activate mason_cliIf either is missing the command logs why and falls back to the built-in templates.
When to use this
Use app create when adding a new host application to the workspace. Common scenarios:
- Adding a second app variant (e.g.,
template_app_widgetbookalongsidetemplate_app) - Setting up a white-label app for a different brand
- Creating a standalone demo app for a specific feature