SocketTerminalBackend constructor

SocketTerminalBackend(
  1. Socket socket, {
  2. TerminalDimensions initialSize = (width: 80, height: 24),
  3. bool supportsAnsi = true,
  4. bool isTerminal = false,
  5. ColorProfile colorProfile = ColorProfile.trueColor,
  6. 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,
  );
}