listen method
- @Deprecated('Listen to \'stream\' directly')
- void onTransition(
- StateChange stateChange
- Function? onError,
- void onDone()?,
- bool? cancelOnError,
Listen for transition events. Transition event occurs every time this transition executes successfully.
onData
will be called with the State that was transitioned from.
Implementation
@Deprecated('Listen to \'stream\' directly')
StreamSubscription listen(void onTransition(StateChange stateChange),
{Function? onError, void onDone()?, bool? cancelOnError}) {
final streamSubscription = listenToStream(_stream, onTransition,
onError: onError, onDone: onDone, cancelOnError: cancelOnError);
return streamSubscription;
}