writeAligned method

void writeAligned(
  1. Object text, [
  2. int? width,
  3. TextAlignment alignment = TextAlignment.left
])
inherited

Writes a quantity of text to the console with padding to the given width.

Implementation

void writeAligned(
  Object text, [
  int? width,
  TextAlignment alignment = TextAlignment.left,
]) {
  final textAsString = text.toString();
  stdout.write(
    textAsString.alignText(
      width: width ?? textAsString.length,
      alignment: alignment,
    ),
  );
}