eventListen<T> function

StreamSubscription<T> eventListen<T>(
  1. void onData(
    1. T
    )?, {
  2. Function? onError,
  3. void onDone()?,
  4. bool? cancelOnError,
})

监听事件总线

Implementation

StreamSubscription<T> eventListen<T>(
  void Function(T)? onData, {
  Function? onError,
  void Function()? onDone,
  bool? cancelOnError,
}) {
  return eventBus.on<T>().listen(
        onData,
        onError: onError,
        onDone: onDone,
        cancelOnError: cancelOnError,
      );
}