skip method
- int count
Skips the next count
data events.
The count
must be non-negative.
When successful, this is equivalent to using take and ignoring the result.
If an error occurs before count
data events have been skipped,
the returned future completes with that error instead.
If the stream closes before count
data events,
the remaining unskipped event count is returned.
If the returned future completes with the integer 0
,
then all events were succssfully skipped. If the value
is greater than zero then the stream ended early.
Implementation
Future<int> skip(int count) {
RangeError.checkNotNegative(count, 'count');
_checkNotClosed();
var request = _SkipRequest<T>(count);
_addRequest(request);
return request.future;
}