padText method Null safety

String padText(
  1. String s,
  2. int amount
)

Implementation

String padText(String s, int amount) {
  return s
      .replaceAll(RegExp(r'^', multiLine: true), ''.padLeft(amount))
      .trimLeft();
}