leftPadding static method

String leftPadding(
  1. String s,
  2. int width
)

Implementation

static String leftPadding(String s, int width) {
  const paddingData = '000000000000000';
  final paddingWidth = width - s.length;
  if (paddingWidth < 1) {
    return s;
  }
  return "${paddingData.substring(0, paddingWidth)}$s";
}