CommandWidget.text constructor

CommandWidget.text({
  1. required OutputWidget textOutputUi,
  2. OutputWidget? jsonOutputUi,
  3. OutputWidget? yamlOutputUi,
  4. OutputWidget? textErrorUi,
  5. OutputWidget? jsonErrorUi,
  6. OutputWidget? yamlErrorUi,
})

Convenience constructor that auto-creates standard json, yaml, and error widgets unless provided.

Implementation

CommandWidget.text({
  required this.textOutputUi,
  final OutputWidget? jsonOutputUi,
  final OutputWidget? yamlOutputUi,
  final OutputWidget? textErrorUi,
  final OutputWidget? jsonErrorUi,
  final OutputWidget? yamlErrorUi,
}) : jsonOutputUi =
         jsonOutputUi ??
         FormattedStringWidget(formatter: JsonOutputFormatter()),
     yamlOutputUi =
         yamlOutputUi ??
         FormattedStringWidget(formatter: YamlOutputFormatter()),
     textErrorUi = textErrorUi ?? TextErrorWidget(),
     jsonErrorUi = jsonErrorUi ?? JsonErrorWidget(),
     yamlErrorUi = yamlErrorUi ?? YamlErrorWidget();