lookAhead method

Future<List<T>> lookAhead (
  1. int count
)

Look at the next count data events without consuming them.

Works like take except that the events are left in the queue. If one of the next count events is an error, the returned future completes with this error, and the error is still left in the queue.

Implementation

Future<List<T>> lookAhead(int count) {
  if (count < 0) throw RangeError.range(count, 0, null, 'count');
  if (!_isClosed) {
    var request = _LookAheadRequest<T>(count);
    _addRequest(request);
    return request.future;
  }
  throw _failClosed();
}