TerminalBridgeMessage class final

JSON-serializable bridge message for remote/browser terminal hosts.

This is the transport schema layered above TerminalBridge. It is intended for line-delimited JSON channels, websockets, or any other message-oriented transport where the host and runtime are in different processes.

Constructors

TerminalBridgeMessage.fromJson(Map<String, dynamic> json)
Decodes a bridge message from JSON.
factory
TerminalBridgeMessage.inputBytes(List<int> bytes)
Creates a binary input message from the host to the runtime.
factory
TerminalBridgeMessage.inputText(String text)
Creates a text input message from the host to the runtime.
const
TerminalBridgeMessage.output(String data)
Creates an output message from the runtime to the host.
const
TerminalBridgeMessage.resize({required int width, required int height})
Creates a resize notification.
const
TerminalBridgeMessage.shutdown()
Creates a shutdown notification.
const

Properties

bytesBase64 String?
Base64 payload for TerminalBridgeMessageType.inputBytes.
final
data String?
String payload for TerminalBridgeMessageType.output and TerminalBridgeMessageType.inputText.
final
hashCode int
The hash code for this object.
no setterinherited
height int?
Height payload for TerminalBridgeMessageType.resize.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type TerminalBridgeMessageType
Message kind.
final
width int?
Width payload for TerminalBridgeMessageType.resize.
final

Methods

decodeBytes() List<int>?
Decodes bytesBase64 for binary input messages.
encodeJson() String
Encodes this message as a single JSON object string.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Encodes this message to JSON.
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

decodeJson(String source) TerminalBridgeMessage
Decodes a single JSON object string into a bridge message.