neverEmits function Null safety

StreamMatcher neverEmits(
  1. dynamic matcher

Returns a StreamMatcher that matches a stream that never matches matcher.

This doesn't complete until the stream emits a done event. It never consumes any events. It never re-throws errors.


StreamMatcher neverEmits(matcher) {
  var streamMatcher = emits(matcher);
  return StreamMatcher((queue) async {
    var events = 0;
    var matched = false;
    await queue.withTransaction((copy) async {
      while (await copy.hasNext) {
        matched = await _tryMatch(copy, streamMatcher);
        if (matched) return false;


        try {
        } catch (_) {
          // Ignore errors events.

      matched = await _tryMatch(copy, streamMatcher);
      return false;

    if (!matched) return null;
    return "after $events ${pluralize('event', events)} did "
  }, 'never ${streamMatcher.description}');