padBoth static method
Pads both sides of value with pad until length is reached.
Implementation
static String padBoth(String value, int length, [String pad = ' ']) {
if (value.length >= length || pad.isEmpty) return value;
final short = length - value.length;
final leftLen = (short / 2).floor();
final rightLen = short - leftLen;
return '${_repeatToLen(pad, leftLen)}$value${_repeatToLen(pad, rightLen)}';
}