RxBlocBuilder<B extends RxBlocTypeBase, T> class
RxBlocBuilder is a Flutter widget which requires a bloc from the RxBloc ecosystem, a builder and a state function. RxBlocBuilder handles building the widget in response to new states. RxBlocBuilder is very similar to StreamBuilder but has a more simple API to reduce the amount of boilerplate code needed.
- The builder function will potentially be called many times and should be a pure function that returns a widget in response to the state.
- The state function determines which exact state of the bloc will be used.
- If the bloc parameter is omitted, RxBlocBuilder will automatically perform a lookup using RxBlocProvider and the current BuildContext.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- RxBlocBuilder
Constructors
-
RxBlocBuilder({required Stream<
T> state(B), required Widget builder(BuildContext, AsyncSnapshot<T> , B), B? bloc, Key? key}) -
Default RxBlocBuilder constructor
const
Properties
- bloc → B?
-
Optional bloc parameter which can be supplied if the specified bloc type
can't be found in the current widget tree. Can be useful if the widget is
inside a
BuildContext
that does not contain a bloc of the specified typefinal -
builder
→ Widget Function(BuildContext, AsyncSnapshot<
T> , B) -
The builder callback which returns a widget, executed every time there
is a change in the listened state
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ Stream<
T> Function(B) -
The state of the bloc that is being listened to for changes
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited