Skip to content

Instantly share code, notes, and snippets.

@kwalrath
Last active January 31, 2020 22:31
Show Gist options
  • Save kwalrath/bebeafec39c977f5764472327cd4f8ff to your computer and use it in GitHub Desktop.
Save kwalrath/bebeafec39c977f5764472327cd4f8ff to your computer and use it in GitHub Desktop.
class NumberCreator {
NumberCreator() {
Timer.periodic(Duration(seconds: 1), (t) {
_controller.sink.add(_count);
_count++;
});
}
var _count = 1;
final _controller = StreamController<int>();
Stream<int> get stream => _controller.stream;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment