EmbeddedTerminalBackend constructor
EmbeddedTerminalBackend({
- required void output(
- String data
- Future<
void> flushOutput()?, - Stream<
List< ? inputStream,int> > - Stream<
TerminalDimensions> ? resizeStream, - Stream<
void> ? shutdownStream, - 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 an embedded backend.
Use addInput, notifySizeChanged, and requestShutdown to drive it from an external host, or provide external streams up front.
Implementation
EmbeddedTerminalBackend({
required void Function(String data) output,
Future<void> Function()? flushOutput,
Stream<List<int>>? inputStream,
Stream<TerminalDimensions>? resizeStream,
Stream<void>? shutdownStream,
TerminalDimensions initialSize = const (width: 80, height: 24),
this.supportsAnsi = true,
this.isTerminal = true,
this.colorProfile = ColorProfile.trueColor,
this.movementCaps = const (useTabs: false, useBackspace: true),
}) : _output = output,
_flushOutput = flushOutput,
_size = initialSize {
_inputStreamSubscription = inputStream?.listen(_inputController.add);
_resizeStreamSubscription = resizeStream?.listen(_resizeController.add);
_shutdownStreamSubscription = shutdownStream?.listen(
(_) => _shutdownController.add(null),
);
}