Skip to content

Instantly share code, notes, and snippets.

@doug-orchard
Created June 30, 2020 12:18
Show Gist options
  • Save doug-orchard/909a3585074720930e6e13c8816b8125 to your computer and use it in GitHub Desktop.
Save doug-orchard/909a3585074720930e6e13c8816b8125 to your computer and use it in GitHub Desktop.
import 'dart:async';
int handleData(int data) {
return data * 2;
}
void main() {
final controller = StreamController<int>();
controller.stream
.map(handleData)
.listen((data) {
print('data: $data');
});
controller.add(1);
controller.add(2);
controller.add(3);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment