padLeft static method

String padLeft(
  1. String value,
  2. int length, [
  3. String pad = ' '
])

Pads the left side of value.

Implementation

static String padLeft(String value, int length, [String pad = ' ']) {
  if (value.length >= length || pad.isEmpty) return value;
  return '${_repeatToLen(pad, length - value.length)}$value';
}