repeat method

String repeat(
  1. int times
)

Repeat the string times (>= 0).

Implementation

String repeat(int times) {
  if (times <= 0) return '';
  return List.filled(times, this).join();
}