Skip to content

StreamBuilder

Rebuilds with the latest AsyncSnapshot of stream — each event, error, and close. Cancels its subscription on dispose and re-subscribes only when the stream identity changes.

Learn more: Loading data

Import: package:fleury/fleury.dart, or package:fleury/fleury_core.dart in browser code.

StreamBuilder<int>(
stream: ticks,
initialData: 0,
builder: (context, snapshot) => Text('tick ${snapshot.data ?? 0}'),
)
ParameterTypeDefaultDescription
stream:Stream<T>?requiredThe stream to observe. A null stream stays disconnected.
initialData:T?—Data exposed before stream emits, or null when there is no seed value.
builder:AsyncWidgetBuilder<T>requiredBuilds the subtree after each data event, error, and connection change.

StreamBuilder is defined in packages/fleury/lib/src/widgets/async.dart.

Category: State & async · All widgets