Terminal constructor
Terminal({
- required String websocketUrl,
- TerminalController? controller,
- String title = 'Terminal',
- Object height = 400,
- bool showToolbar = true,
- bool autoConnect = true,
- bool autoReconnect = true,
- Duration reconnectDelay = const Duration(seconds: 2),
- bool sendResizeMessages = true,
- int fontSize = 13,
- String fontFamily = 'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace',
- int scrollback = 5000,
- TerminalTheme theme = const TerminalTheme(),
- String connectingMessage = 'Connecting to terminal...',
- String scriptUrl = 'https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js',
- String stylesheetUrl = 'https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css',
- String? className,
- Map<
String, Object?> props = const {}, - Map<
String, Object?> style = const {}, - DartStyle? dartStyle,
- void onConnectionStateChanged(
- TerminalConnectionState state
- void onInput(
- String data
- void onOutput(
- String data
- void onResize()?,
- void onError(
- Object error
Creates an interactive WebSocket terminal.
Implementation
Terminal({
required this.websocketUrl,
this.controller,
this.title = 'Terminal',
this.height = 400,
this.showToolbar = true,
this.autoConnect = true,
this.autoReconnect = true,
this.reconnectDelay = const Duration(seconds: 2),
this.sendResizeMessages = true,
this.fontSize = 13,
this.fontFamily =
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace',
this.scrollback = 5000,
this.theme = const TerminalTheme(),
this.connectingMessage = 'Connecting to terminal...',
this.scriptUrl = 'https://cdn.jsdelivr.net/npm/xterm@5.3.0/lib/xterm.js',
this.stylesheetUrl =
'https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css',
this.className,
this.props = const {},
this.style = const {},
this.dartStyle,
this.onConnectionStateChanged,
this.onInput,
this.onOutput,
this.onResize,
this.onError,
});