thenAnswerWithCustomStream method

void thenAnswerWithCustomStream(
  1. Stream<T> stream
)

Implementation

void thenAnswerWithCustomStream(Stream<T> stream) => thenAnswer((i) {
  final callback = i.positionalArguments.singleOrNull;

  // ignore: no-empty-block, it needs to be empty, prefer-typedefs-for-callbacks, private API
  return stream.listen(callback != null ? callback as void Function(T value) : (_) {});
});