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) {
  RangeError.checkNotNegative(count, 'count');
  _checkNotClosed();
  var request = _LookAheadRequest<T>(count);
  _addRequest(request);
  return request.future;
}