Mason reusable bricks for efficient project scaffolding.
To add a brick, you have a few options:
# 🎯 Activate Mason CLI (if not done already):
dart pub global activate mason_cli
# Add a brick from a Git URL:
mason add <BRICK_NAME> --git-url https://github.com/shyamexe/bricks-cli --git-path path/to/<BRICK_NAME>
# Add a brick globally from a Git URL:
mason add -g <BRICK_NAME> --git-url https://github.com/shyamexe/bricks-cli --git-path path/to/<BRICK_NAME>
# For instance, to add the flutter-package brick:
mason add -g flutter-template --git-url https://github.com/shyamexe/bricks --git-path flutter-template
name | description |
---|---|
flutter-package |
Create a new Flutter project with basic structure |
bloc |
Generate a new Bloc |
cubit |
Generate a new Cubit |
feature-block |
Generate a new module block |
# Add flutter-template from GitHub
mason add -g flutter-template --git-url https://github.com/shyamexe/bricks --git-path flutter-template
# List all globally installed bricks
mason ls -g
# Generate code using the brick
mason make flutter-template
# Remove the brick (global)
mason remove -g flutter-template
# Globally add cubit brick from GitHub
mason add -g cubit --git-url https://github.com/shyamexe/bricks --git-path cubit
# Generate a new Cubit
mason make cubit --name counter --style equatable
1 Create mason/mason.yaml in your project root:
bricks:
cubit:
git:
url: https://github.com/shyamexe/bricks-cli.git
path: cubit
2 Run the following commands:
mason get
mason make cubit -o ..\Yoru\output\folder\ --name counter --style equatable