Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Solution for "How to use Streams in Dart (Part 1)" blog post series
import 'dart:async';
void main() {
var streamController = StreamController();
streamController.stream.listen(
(data) => print('Got eem! $data'),
onError: (err) => print('Got an error! $err'),
onDone: () => print('Mission complete!'),
cancelOnError: false,
);
streamController.sink.add('Foo');
streamController.sink.addError('Houston, we have a problem!');
streamController.sink.close();
}
@graphicbeacon

This comment has been minimized.

Copy link
Owner Author

graphicbeacon commented Feb 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.