CliDialog.std constructor

CliDialog.std(
  1. StdinService _stdInput,
  2. StdoutService _stdOutput, {
  3. List? messages,
  4. List? questions,
  5. List? booleanQuestions,
  6. List? listQuestions,
  7. List<String>? order,
  8. bool trueByDefault = false,
  9. bool navigationMode = false,
})

This named constructor should mostly be used when unit testing.

var std_output = StdoutService(mock: true);
var std_input = StdinService(mock: true, informStdout: std_output);
std_input.addToBuffer(...Keys.arrowDown, Keys.enter);
final dialog = CLI_Dialog.std(std_input, std_output, listQuestions: listQuestions);

Implementation

CliDialog.std(this._stdInput, this._stdOutput,
    {this.messages,
    this.questions,
    this.booleanQuestions,
    this.listQuestions,
    this.order,
    this.trueByDefault = false,
    this.navigationMode = false}) {
  _checkQuestions();
  _initializeLists();
}