https://dart.dev/tutorials/language/streams
Asynchronous programming in Dart is characterized by the Future and Stream classes.
an asynchronous sequence of data
You can process a stream using either await for or listen() from the Stream API.
Streams provide a way to respond to errors.
There are two kinds of streams: single subscription or broadcast.
일반 함수가 즉시 값을 반환한다면,
asynchronous 함수는 Future 를 반환한다. 이것은 미래에 값을 담게 될 것이다.
최초 반환시에는 비어있는 Future 타입 값임. synchronous 하게 사용할 때 확인했음
Stream 타입을 반환하는 메서드
yeildStream<int> countStream(int to) async* {
for (int i = 1; i <= to; i++) {
yield i;
}
}