listen method

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

Implementation

StreamSubscription<List<int>> listen(
  void Function(List<int> data)? onData, {
  Function? onError,
  void Function()? onDone,
  bool? cancelOnError,
}) {
  return sslEnabled
      ? _secureResponseController.stream.listen(
          onData,
          onError: onError,
          onDone: onDone,
          cancelOnError: cancelOnError,
        )
      : _responseController.stream.listen(
          onData,
          onError: onError,
          onDone: onDone,
          cancelOnError: cancelOnError,
        );
}