Generates a new Bloc in Dart. Built for the bloc state management library.
To get started, install mason using one of the following methods:
# 🎯 Activate from https://pub.dev
dart pub global activate mason_cli
# 🍺 Or install from https://brew.sh
brew tap felangel/mason
brew install mason
We recommend using asdf as a version manager. Follow these steps to set up:
- Install asdf.
- Use the Flutter version specified in .tool-versions by running this command:
asdf install
- Ensure sure you have flutter_bloc installed:
flutter pub add flutter_bloc
Register the brick with the following command:
mason add bloc --path bricks/bloc
Now you can utilize the brick with:
mason make bloc
Variable | Description | Default | Type |
---|---|---|---|
name |
The name of the BLoC class | Test |
string |
└── test
├── bloc.dart
├── event.dart
└── state.dart