FakeCliTerminal.interactive constructor

FakeCliTerminal.interactive({
  1. List<String> input = const [],
  2. List<String> answers = const [],
  3. int width = 80,
  4. int height = 24,
  5. FakeClock? fakeClock,
  6. bool progressReports = false,
})

Somebody answers at a terminal that redraws, width × height cells: the inline session gets input as typed, and answers an entry for each question as it shows. fakeClock times it, the wall clock without one; progressReports as above.

final terminal = FakeCliTerminal.interactive(answers: ['ada\r', 'y']);
final cli = Cli(terminal: terminal);
final name = await cli.prompt('Name?');
final sure = await cli.confirm('Sure?');

Implementation

FakeCliTerminal.interactive({
  List<String> input = const [],
  List<String> answers = const [],
  int width = 80,
  int height = 24,
  FakeClock? fakeClock,
  bool progressReports = false,
}) : this(
       ansi: true,
       interactiveInput: true,
       outputIsTerminal: true,
       input: input,
       answers: answers,
       width: width,
       height: height,
       fakeClock: fakeClock,
       progressReports: progressReports,
     );