padLeft method

String? padLeft(
  1. int width, [
  2. String padding = ' '
])

Pads this string on the left if it is shorter than width.

Return a new string that prepends padding onto this string one time for each position the length is less than width.

Implementation

String? padLeft(int width, [String padding = ' ']) {
  return value?.padLeft(width, padding);
}