CommandWidget.stream constructor
CommandWidget.stream({
- required OutputWidget textOutputUi,
- OutputWidget? jsonOutputUi,
- OutputWidget? yamlOutputUi,
- OutputWidget? textErrorUi,
- OutputWidget? jsonErrorUi,
- OutputWidget? yamlErrorUi,
Like CommandWidget.text, but json/yaml emit one document per stream element instead of encoding the whole result. This is also used for operations that conceptually return a single result, but is awaited as a stream to allow for progress reporting.
Implementation
CommandWidget.stream({
required this.textOutputUi,
OutputWidget? jsonOutputUi,
OutputWidget? yamlOutputUi,
OutputWidget? textErrorUi,
OutputWidget? jsonErrorUi,
OutputWidget? yamlErrorUi,
}) : jsonOutputUi =
jsonOutputUi ??
FormattedStreamStringWidget(formatter: JsonOutputFormatter()),
yamlOutputUi =
yamlOutputUi ??
FormattedStreamStringWidget(
formatter: YamlOutputFormatter.document(),
),
textErrorUi = textErrorUi ?? TextErrorWidget(),
jsonErrorUi = jsonErrorUi ?? JsonErrorWidget(),
yamlErrorUi = yamlErrorUi ?? YamlErrorWidget();