BlocBuilder and BlocSelector
Learn about BlocBuilder and BlocSelector and how they are used by widgets to listen to state changes.
We'll cover the following...
The BlocBuilder
widget
Remember how we used StreamBuilder
to listen to BLoC changes when we implemented BLoC ourselves? The BlocBuilder
widget is used to simplify and clean up the StreamBuilder
to fit the BLoC needs.
Usage
Two parameters are needed for the BlocBuilder
widget: bloc
and ...