listen method
- @Deprecated('Use stream.listen instead. Will be removed in v8.0.0')
- void onData(
- StatefulState<
Data>
- StatefulState<
- Function? onError,
- void onDone()?,
- bool? cancelOnError,
inherited
Adds a subscription to the Stream<State>
.
Returns a StreamSubscription which handles events from
the Stream<State>
using the provided onData
, onError
and onDone
handlers.
Implementation
@Deprecated(
'Use stream.listen instead. Will be removed in v8.0.0',
)
StreamSubscription<State> listen(
void Function(State)? onData, {
Function? onError,
void Function()? onDone,
bool? cancelOnError,
}) {
return stream.listen(
onData,
onError: onError,
onDone: onDone,
cancelOnError: cancelOnError,
);
}