Skip to content

Demonstrage how to use mason to generate a BLoC in Dart.

License

Notifications You must be signed in to change notification settings

cosee/mason_blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BLoC

Generates a new Bloc in Dart. Built for the bloc state management library.

Prerequisite 🛠

Mason setup

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

Flutter setup

We recommend using asdf as a version manager. Follow these steps to set up:

  1. Install asdf.
  2. Use the Flutter version specified in .tool-versions by running this command:
asdf install
  1. Ensure sure you have flutter_bloc installed:
flutter pub add flutter_bloc

Usage 🚀

Register the brick with the following command:

mason add bloc --path bricks/bloc

Now you can utilize the brick with:

mason make bloc

Variables ✨

Variable Description Default Type
name The name of the BLoC class Test string

Output 📦

└── test
    ├── bloc.dart
    ├── event.dart
    └── state.dart

About

Demonstrage how to use mason to generate a BLoC in Dart.

Topics

Resources

License

Stars

Watchers

Forks

Languages