OnBuilder<T>.createStream constructor
OnBuilder<T>.createStream ({
- Key? key,
- required Stream<
T> creator(), - T? initialState,
- SideEffects<
T> ? sideEffects, - required Widget builder(
- ReactiveModel<
T> rm
- ReactiveModel<
Create a ReactiveModel state from a stream and listen to it
Implementation
OnBuilder.createStream({
Key? key,
required Stream<T> Function() creator,
T? initialState,
SideEffects<T>? sideEffects,
required Widget Function(ReactiveModel<T> rm) builder,
}) : super(
key: key,
observers: (_) => [
ReactiveModel<T>.create(
creator: creator,
initialState: initialState,
autoDisposeWhenNotUsed: true,
) as ReactiveModelImp
],
builder: (_, __, rm) => builder(rm),
sideEffects: sideEffects,
);