MessageEvent constructor
Implementation
factory MessageEvent(String type, {bool canBubble: false, bool cancelable: false, Object? data, String? origin, String? lastEventId, Window? source, List<MessagePort> messagePorts: const []}) { if (source == null) { source = window; } if (!Device.isIE) { // TODO: This if check should be removed once IE // implements the constructor. return JS( 'MessageEvent', 'new MessageEvent(#, {bubbles: #, cancelable: #, data: #, origin: #, lastEventId: #, source: #, ports: #})', type, canBubble, cancelable, data, origin, lastEventId, source, messagePorts); } MessageEvent event = document._createEvent("MessageEvent") as MessageEvent; event._initMessageEvent(type, canBubble, cancelable, data, origin, lastEventId, source, messagePorts); return event; }
© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.13.0/dart-html/MessageEvent/MessageEvent.html