Skip to content

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 ​

bash
# Create a new app
dart run monorepo_toolkit app create --name my_app --org com.example
app createA new host app in one command, then four steps

Step 1 of 5, start: The command checks that the name is snake_case and that apps/<name> does not exist yet. It then prints the name, the organization and the domain, which it takes from the organization reversed. --org is optional.

dart run monorepo_toolkit app create --name admin_app --org com.acmeℹ Scaffolding new app: admin_appℹ   Organization: com.acmeℹ   Domain: acme.comℹ

Flags ​

FlagAbbrDefaultDescription
--name-nrequiredApp name in snake_case (e.g., my_app)
--org-ocom.exampleReverse-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-dderived from orgShown 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:

  1. Mason brick (preferred) -- If the app_scaffold Mason 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.

  2. 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.yaml

The 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:

bash
# 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_app

Mason 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:

bash
dart pub global activate mason_cli

If 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_widgetbook alongside template_app)
  • Setting up a white-label app for a different brand
  • Creating a standalone demo app for a specific feature