Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. import 'dart:async';
  2.  
  3. void main() {
  4. final controller = new StreamController<int>();
  5.  
  6. controller.add(10);
  7. controller.stream.listen((a) => print('receive: $a'));
  8.  
  9. final contrtoller2 = new StreamController<int>.broadcast();
  10.  
  11. contrtoller2.add(20);
  12. contrtoller2.stream.listen((b) => print('receive $b'));
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement