output method

String output()

Prints string closed with reset, and hands back what it printed.

The return is the same string the terminal got, so it can go into a log or a test as well.

Implementation

String output() {
  final line = toString();
  // ignore: avoid_print
  print(line);

  return line;
}