getName static method

String getName(
  1. int level
)

Implementation

static String getName(int level) {
  return levels.entries
      .map((entry) => MapEntry((entry.key - level).abs(), entry.value))
      .reduce((current, next) => current.key > next.key ? next : current)
      .value;
}