writeLine method

void writeLine(
  1. String text, {
  2. TextAlignment alignment = TextAlignment.left,
})

Writes text to the console followed by a newline. You can control the alignment of text by passing the optional alignment argument which defaults to left alignment. The alignment is based on the current terminals width with spaces inserted to the left of the string to facilitate the alignment. Make certain the current line is clear and the cursor is at column 0 before calling this method otherwise the alignment will not work as expected.

Implementation

void writeLine(String text, {TextAlignment alignment = TextAlignment.left}) =>
    _console.writeLine(text, alignment);