To install Mason CLI, ensure you have the Dart SDK installed on your machine.
We recommend installing mason_cli
from pub.dev using the following command:
# Activate Mason CLI from pub.dev
dart pub global activate mason_cli
After successful installation, you can verify your setup by running the mason
command in your terminal. A successful installation will yield an output similar to the following:
🧱 mason • lay the foundation!
Usage: mason <command> [arguments]
Global options:
-h, --help Print this usage information.
--version Print the current version.
Available commands: ...
To retrieve the Mason feature, run the following command:
mason get
To create a new feature with Mason, use the command:
mason make feature
When prompted, enter the name of the feature you want to add. For example, to add a "product" feature, input:
Enter the feature name:
product
A successful addition of a new feature will generate output similar to this:
? What is your name? (Dash) product
✓ Generated 9 files. (0.1s)
created lib\features\product\data\models\data_model.dart
created lib\features\product\data\models\test_data_model.dart
created lib\features\product\data\repositories\product_repository.dart
created lib\features\product\domain\entities\data.dart
created lib\features\product\domain\entities\test_data.dart
created lib\features\product\presentation\state_holders\if_data_in_list.dart
created lib\features\product\presentation\state_holders\product_controller.dart
created lib\features\product\presentation\ui\screens\product_screen.dart
created lib\features\product\presentation\ui\widgets\product_widgets.dart
You can right-click on the directory that you need to hide and select:
Mark Directory as -> Excluded
If you want to include a directory back, find the path of your excluded directory and:
Right-click -> Mark Directory as -> Cancel Exclusion
Add this code:
"dart.analysisExcludedFolders": [
"bricks"
]
in settings.json
in VS Code to ignore the bricks
folder.