Skip to content

Instantly share code, notes, and snippets.

@Aetet
Created August 23, 2021 06:01
Show Gist options
  • Save Aetet/7078a6dfd64432536cf774f201203504 to your computer and use it in GitHub Desktop.
Save Aetet/7078a6dfd64432536cf774f201203504 to your computer and use it in GitHub Desktop.
accumulate stream
void main() {
var counterStream =
Stream<int>.periodic(const Duration(seconds: 1), (x) => x).take(15);
var mas = <int>[];
counterStream.listen((num) {
mas.add(num);
print("mas: ${mas}");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment