format static method

String format(
  1. String template,
  2. List values
)

Replaces placeholders {0}, {1}, etc. with provided values

Implementation

static String format(String template, List<dynamic> values) {
  String result = template;
  for (int i = 0; i < values.length; i++) {
    result = result.replaceAll('{$i}', values[i].toString());
  }
  return result;
}