pad static method

String pad(
  1. String text,
  2. int width
)

Pads the text with spaces to the given number of terminal columns

Implementation

static String pad(String text, int width) {
  int missing = width - Mansil.visibleWidth(text);
  return missing > 0 ? "$text${" " * missing}" : text;
}