writeCentered method

void writeCentered(
  1. String text
)

Implementation

void writeCentered(String text) {
  var column = ((Console.columns / 2) - (text.length / 2)).round();
  var row = (Console.rows / 2).round();
  Console.moveCursor(row: row, column: column);
  Console.write(text);
}