Flutter Module Creator
Create modules in a Melos monorepo workspace with proper configuration.
Usage
dart run <skill_path>/scripts/create_module.dart --type <type> --name <name> [options]
Module Types
app: Flutter application (use--consolefor Dart console app)package: Dart package (use--flutterfor Flutter package)plugin: Flutter pluginffi: Flutter FFI plugin
Options
--console: Create Dart console app (app type only)--flutter: Create Flutter package (package type only)--platforms <list>: Comma-separated platforms (plugin/ffi), e.g.,android,ios--workspace <path>: Workspace root (auto-detected)--no-bootstrap: Skip melos bootstrap
Examples
# Basic usage
dart run <skill_path>/scripts/create_module.dart --type app --name my_app
dart run <skill_path>/scripts/create_module.dart --type package --name my_utils
# With options
dart run <skill_path>/scripts/create_module.dart --type app --name my_cli --console
dart run <skill_path>/scripts/create_module.dart --type package --name my_widgets --flutter
dart run <skill_path>/scripts/create_module.dart --type plugin --name my_plugin --platforms android,ios
What It Does
- Detects workspace root (melos/workspace in pubspec.yaml)
- Creates module in
apps/orpackages/directory - Configures
analysis_options.yamlwith appropriate lints - Adds
resolution: workspaceto module pubspec.yaml - Updates root
workspace:list - Copies LICENSE from workspace root
- Runs
melos bootstrap(unless--no-bootstrap)
Post-Creation Cleanup (REQUIRED)
After creating a module, you MUST clean up the boilerplate code:
- Delete or replace generated placeholder source files (e.g.,
lib/src/*_base.dartwithAwesomeclass) - Update
example/with actual usage code (removeAwesomereferences) - Update the barrel export file (
lib/<name>.dart) to export real files - Run
melos analyzeto verify no dead code or missing references
Converted and distributed by TomeVault — claim your Tome and manage your conversions.