elementAt method

  1. @override
ObservableFuture<T> elementAt(
  1. int index
)
override

Returns the value of the indexth data event of this stream.

Stops listening to this stream after the indexth data event has been received.

Internally the method cancels its subscription after these elements. This means that single-subscription (non-broadcast) streams are closed and cannot be reused after a call to this method.

If an error event occurs before the value is found, the future completes with this error.

If a done event occurs before the value is found, the future completes with a RangeError.

Implementation

@override
ObservableFuture<T> elementAt(int index) =>
    _wrapFuture(_controller.stream.elementAt(index));