Created
August 23, 2021 06:01
-
-
Save Aetet/7078a6dfd64432536cf774f201203504 to your computer and use it in GitHub Desktop.
accumulate stream
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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