bloc_annotations: ^0.6.0 copied to clipboard
Annotations for the bloc_generator package that will generate BLoC architected code automatically.
This package is part of a number of packages designed to help create BLoC architected code in Dart and Flutter. You can view them all in the repository here.
This README relies on the fact that you have read the main README.
dependencies: bloc_annotations: <latest_version>
Input Class #
All the annotated members of your BLoC class that have annotations must be
public as the generated code uses them. Members without annotations can still be
used normally such as in
@BLoCValues initial data will
will be added to the stream once all service have been initialized.
Different Controllers #
StreamController isn't required so
subjects such as
BehaviourSubject can be used as shown in the
Output Class #
The output class can be seen in the generated
.bloc.dart file. The BLoCs name
will be the same as the template class with the suffix of
Importing the Output Class #
.bloc.dart file uses a
part of statment, so your template file
must contain a