MessagePort class

The interface of the Channel Messaging API represents one of the two ports of a MessageChannel, allowing messages to be sent from one port and listening out for them arriving at the other. Note: This feature is available in Web Workers

EventTarget

MessagePort

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

MessagePort()
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
onmessage EventHandlerNonNull<Event>?

Available on MessagePort, provided by the PropsMessagePort extension

getter/setter pair
onmessageerror EventHandlerNonNull<Event>?

Available on MessagePort, provided by the PropsMessagePort extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

close() → void

Available on MessagePort, provided by the PropsMessagePort extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postMessage(dynamic message, Iterable transfer) → void

Available on MessagePort, provided by the PropsMessagePort extension

removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

start() → void

Available on MessagePort, provided by the PropsMessagePort extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited