File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,4 +14,9 @@ void main() {
1414 // Do a CSS query
1515 print (divElement.querySelector ('div > .greeting' )! .text);
1616 // --> Hello world
17+
18+ final broadcastChannel = BroadcastChannel ('Channel_Name' );
19+ broadcastChannel.onMessage.listen ((event) {
20+ print (event);
21+ });
1722}
Original file line number Diff line number Diff line change @@ -87,6 +87,7 @@ part 'html/api/web_socket.dart';
8787part 'html/api/window.dart' ;
8888part 'html/api/window_misc.dart' ;
8989part 'html/api/workers.dart' ;
90+ part 'html/api/broadcast_channel.dart' ;
9091part 'html/dom/css.dart' ;
9192part 'html/dom/css_computed_style.dart' ;
9293part 'html/dom/css_rect.dart' ;
Original file line number Diff line number Diff line change 1+ part of universal_html.internal;
2+
3+ class BroadcastChannel {
4+ final String name;
5+
6+ BroadcastChannel (this .name);
7+
8+ void close () {}
9+
10+ void postMessage (Object message) {}
11+
12+ Stream <dynamic > get onMessage => const Stream .empty ();
13+ }
You can’t perform that action at this time.
0 commit comments