scan<S>  method 
Applies an accumulator function over a Stream sequence and returns each intermediate result. The seed value is used as the initial accumulator value.
Example
Stream.fromIterable([1, 2, 3])
   .scan((acc, curr, i) => acc + curr, 0)
   .listen(print); // prints 1, 3, 6
Implementation
Stream<S> scan<S>(
        S Function(S accumulated, T value, int index) accumulator, S seed) =>
    ScanStreamTransformer<T, S>(accumulator, seed).bind(this);