write_line method

  1. @override
void write_line([
  1. String? text,
  2. ConsoleTextAlignment alignment = ConsoleTextAlignments.left
])
override

Writes a line to the console, optionally with alignment provided by the ConsoleTextAlignment enumeration.

If no parameters are supplied, the command simply writes a new line to the console. By default, text is left aligned.

Text alignment operates based off the current window width, and pads the remaining characters with a space character.

Implementation

@override
void write_line([
  final String? text,
  final ConsoleTextAlignment alignment = ConsoleTextAlignments.left,
]) {
  if (text != null) {
    stdout.write(
      _apply_alignment(
        alignment,
        text,
        dimensions.width,
      ),
    );
  }
  stdout.write(new_line);
}