ProgramHost class abstract interface

Reusable launch target for a Program.

Use ProgramHost to package backend selection separately from model logic. The current runtime supports:

Constructors

ProgramHost.backend(TerminalBackend backend)
Creates a host backed by backend.
factory
ProgramHost.bridge(TerminalBridge bridge)
Creates a host backed by bridge.
factory
ProgramHost.custom(ProgramHostResolver resolver)
Creates a custom host using resolver.
factory
ProgramHost.jsonChannel({required void sendMessage(String message), required Stream<Object?> inboundMessages, Future<void> flushMessages()?, Future<void> closeTransport()?, TerminalDimensions initialSize = (width: 80, height: 24), bool supportsAnsi = true, bool isTerminal = true, ColorProfile colorProfile = ColorProfile.trueColor, ({bool useBackspace, bool useTabs}) movementCaps = (useTabs: false, useBackspace: true)})
Creates a host backed by a JSON message channel.
factory
ProgramHost.socket(Socket socket, {TerminalDimensions initialSize = (width: 80, height: 24), bool supportsAnsi = true, ColorProfile colorProfile = ColorProfile.trueColor, bool closeSocketOnDispose = true})
Creates a socket-backed host for remote or shell-mode terminals.
factory
ProgramHost.split({required TuiTerminal control, required TuiTerminal output})
Creates a split host with separate control and output terminals.
factory
ProgramHost.stdio({bool inputTTY = false})
Creates a stdio-backed host.
factory
ProgramHost.terminal(TuiTerminal terminal)
Creates a host that always uses terminal.
factory
ProgramHost.webSocket(WebSocket socket, {TerminalDimensions initialSize = (width: 80, height: 24), bool supportsAnsi = true, bool isTerminal = true, ColorProfile colorProfile = ColorProfile.trueColor, ({bool useBackspace, bool useTabs}) movementCaps = (useTabs: false, useBackspace: true), bool closeSocketOnDispose = true})
Creates a websocket-backed host using the JSON bridge protocol.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolve(ProgramOptions options) ProgramHostBinding
Resolves the host against options.
toString() String
A string representation of this object.
inherited

Operators

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