flutter_built_bloc 0.2.12-dev flutter_built_bloc: ^0.2.12-dev copied to clipboard
Generates the BLoC boilerplate.
flutter_built_bloc #
Helper widgets for adopting the BLoC pattern in combination with built_bloc
BlocProvider #
Create a BlocProvider
and give him your Bloc
.
class Example extends StatelessWidget {
@override
Widget build(BuildContext context) {
return BlocProvider(bloc: ExampleBloc(), child: ExampleView());
}
}
You can then access it with the BlocProvider.of
method :
class ExampleView extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bloc = BlocProvider.of<ExampleBloc>(context);
// ...
}
}
How to use #
Install #
dependencies:
flutter_built_bloc: