Port class

Constructors

Port({required String name, required JSFunction disconnect, required JSFunction postMessage, MessageSender? sender})
Port.fromJS(Port _wrapped)

Properties

disconnect JSFunction
Immediately disconnect the port. Calling disconnect() on an already-disconnected port has no effect. When a port is disconnected, no new events will be dispatched to this port.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
name String
The name of the port, as specified in the call to runtime.connect.
getter/setter pair
onDisconnect EventStream<Port>
Fired when the port is disconnected from the other end(s). runtime.lastError may be set if the port was disconnected by an error. If the port is closed via $(ref:Port.disconnect disconnect), then this event is only fired on the other end. This event is fired at most once (see also Port lifetime).
no setter
onMessage EventStream<PortOnMessageEvent>
This event is fired when $(ref:Port.postMessage postMessage) is called by the other end of the port.
no setter
postMessage JSFunction
Send a message to the other end of the port. If the port is disconnected, an error is thrown.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sender MessageSender?
This property will only be present on ports passed to $(ref:runtime.onConnect onConnect) / $(ref:runtime.onConnectExternal onConnectExternal) / $(ref:runtime.onConnectExternal onConnectNative) listeners.
getter/setter pair
toJS → Port
no setter

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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