Skip to content

Instantly share code, notes, and snippets.

@zolotyh
Created August 3, 2019 13:47
Show Gist options
  • Save zolotyh/0626b8cc15175a3fffb8d2f014a21586 to your computer and use it in GitHub Desktop.
Save zolotyh/0626b8cc15175a3fffb8d2f014a21586 to your computer and use it in GitHub Desktop.
import 'dart:async';
import 'dart:io';
void main() async {
var controller = StreamController<int>.broadcast();
controller.stream.listen(print);
controller.stream.listen(print);
controller.sink.add(1);
controller.sink.add(1);
controller.sink.add(1);
controller.sink.add(1);
streamMaker().listen(print);
}
Stream streamMaker() async* {
yield* Directory.current.list();
yield 123123;
yield await Future.delayed(Duration(seconds: 1), () => 1231231231312);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment