listen method Null safety

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

    Implementation

    StreamSubscription<T> listen(
      void Function(T) onData, {
      Function? onError,
      void Function()? onDone,
      bool? cancelOnError,
    }) =>
        subject.listen(
          onData,
          onError: onError,
          onDone: onDone,
          cancelOnError: cancelOnError ?? false,
        );