I want to emit values in a stream from a list with a specific delay in dart.
So, from [1,2,3], which is a regular List I want to emit values like 1...2...3
in separated events.
I tried something like this
List<int> myList = [1,2,3];
Subject _current = BehaviorSubject<int>();
Stream<int> get current$ => _current.stream.delay(Duration(seconds:1));
myList.forEach(current.add);
But I get ...123
instead, so this is delaying the whole stream 1 seconds, rather than every value in the list.
Any ideas? Thanks