Skip to content

Instantly share code, notes, and snippets.

@gie3d
Created December 2, 2022 12:23
Show Gist options
  • Save gie3d/4f491bd9791d0cfecb9add0e3b26b757 to your computer and use it in GitHub Desktop.
Save gie3d/4f491bd9791d0cfecb9add0e3b26b757 to your computer and use it in GitHub Desktop.
void main() {
x();
}
void x() {
final stream = Stream.periodic(const Duration(seconds: 1), (i) => i * i)
.take(5);
final subscription = stream.listen((x) {
print(x);
}, onDone: () {
print("done");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment