padToWidth method
Pads this string to width with padChar, on the left if padLeft else right.
Implementation
@useResult
String padToWidth(int width, {bool padLeft = true, String padChar = ' '}) {
if (length >= width) return this;
final String pad = padChar * (width - length);
return padLeft ? pad + this : this + pad;
}