CLI_Dialog.std constructor

CLI_Dialog.std(
  1. StdinService _std_input,
  2. StdoutService _std_output, {
  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

CLI_Dialog.std(this._std_input, this._std_output,
    {this.messages,
    this.questions,
    this.booleanQuestions,
    this.listQuestions,
    this.order,
    this.trueByDefault = false,
    this.navigationMode = false}) {
  _checkQuestions();
  _initializeLists();
}