ansiPad method

String ansiPad(
  1. int length, {
  2. String pad = " ",
})

Pad string from both sides, ignoring embedded ansi sequences.

Implementation

String ansiPad(int length, {String pad = " "}) {
  var it = this;
  while (it.ansiLength < length) {
    it = pad + it + pad;
  }
  return it.ansiTake(length);
}