IntervalStreamTransformer<S> class

Creates a Stream that emits each item in the Stream after a given duration.

Example

Stream.fromIterable([1, 2, 3])
  .transform(IntervalStreamTransformer(Duration(seconds: 1)))
  .listen((i) => print('$i sec')); // prints 1 sec, 2 sec, 3 sec
Inheritance

Constructors

IntervalStreamTransformer(Duration duration)
Constructs a StreamTransformer which emits each item from the source Stream, after a given duration.

Properties

duration Duration
The interval after which incoming events need to be emitted.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(Stream<S> stream) Stream<S>
Transforms the provided stream.
override
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited