StreamBuilder<T> class
Widget that builds itself based on the latest snapshot of interaction with a Stream.
- Inheritance
-
- Object
- Widget
- StatefulWidget
- StreamBuilder
Constructors
-
StreamBuilder({Key? key, T? initialData, Stream<
T> ? stream, required AsyncWidgetBuilder<T> builder}) -
Creates a new StreamBuilder that builds itself based on the latest
snapshot of interaction with the specified
streamand whose build strategy is given bybuilder.const
Properties
-
builder
→ AsyncWidgetBuilder<
T> -
The build strategy currently used by this builder.
final
- correspondingTag → DomTagType?
-
Corresponding HTML tag to use to render this widget
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialData → T?
-
The data that will be used to create the initial snapshot.
final
- key → Key?
-
Keys help Rad identify which widgets have changed, are added, or are
removed when a widget has multiple sibling widgets.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
T> ? -
The asynchronous computation to which this builder is currently connected,
possibly null. When changed, the current summary is updated using
afterDisconnected, if the previous stream was not null, followed byafterConnected, if the new stream is not null.finalinherited -
widgetCaptureEventListeners
→ Map<
DomEventType, EventCallback?> -
Events that this widget is listening to in capturing phase.
no setterinherited
-
widgetEventListeners
→ Map<
DomEventType, EventCallback?> -
Events that this widget is listening to in bubbling phase.
no setterinherited
Methods
-
afterConnected(
AsyncSnapshot< T> current) → AsyncSnapshot<T> -
Returns an updated version of the
currentsummary reflecting that we are now connected to a stream. -
afterData(
AsyncSnapshot< T> current, T data) → AsyncSnapshot<T> -
Returns an updated version of the
currentsummary following a data event -
afterDisconnected(
AsyncSnapshot< T> current) → AsyncSnapshot<T> -
Returns an updated version of the
currentsummary reflecting that we are no longer connected to a stream. -
afterDone(
AsyncSnapshot< T> current) → AsyncSnapshot<T> -
Returns an updated version of the
currentsummary following stream termination. -
afterError(
AsyncSnapshot< T> current, Object error, StackTrace stackTrace) → AsyncSnapshot<T> -
Returns an updated version of the
currentsummary following an error with a stack trace. -
build(
BuildContext context, AsyncSnapshot< T> currentSummary) → Widget -
Returns a Widget based on the
currentSummary. -
createRenderElement(
RenderElement parent) → RenderElement -
Create element for current widget.
inherited
-
createState(
) → State< StreamBuilderBase< T, AsyncSnapshot< >T> > -
Creates the mutable state for this widget at a given location in the tree.
inherited
-
initial(
) → AsyncSnapshot< T> - Returns the initial summary of stream interaction, typically representing the fact that no interaction has happened at all.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldUpdateWidget(
Widget oldWidget) → bool -
Whether to update current widget.
inherited
-
shouldUpdateWidgetChildren(
Widget oldWidget, bool shouldUpdateWidget) → bool -
Whether to update current widget's children.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited