SocketTerminalBackend constructor
SocketTerminalBackend(
- Socket socket, {
- TerminalDimensions initialSize = (width: 80, height: 24),
- bool supportsAnsi = true,
- bool isTerminal = false,
- ColorProfile colorProfile = ColorProfile.trueColor,
- bool closeSocketOnDispose = true,
Creates a socket-backed backend.
Implementation
SocketTerminalBackend(
this.socket, {
TerminalDimensions initialSize = const (width: 80, height: 24),
this.supportsAnsi = true,
this.isTerminal = false,
this.colorProfile = ColorProfile.trueColor,
this.closeSocketOnDispose = true,
}) : _size = initialSize {
_socketSubscription = socket.listen(
_handleSocketData,
onDone: () {
if (!_shutdownController.isClosed) {
_shutdownController.add(null);
}
},
onError: (error, stackTrace) {
if (!_inputController.isClosed) {
_inputController.addError(error, stackTrace);
}
},
cancelOnError: false,
);
}