class HighScores { List scores; late List sortedScores; HighScores([this.scores = const [0]]) { sortedScores = scores.toList(); sortedScores.sort((a, b) => b.compareTo(a)); } int latest() => scores.last; Iterable personalTopThree() => this.sortedScores.take(3); int personalBest() => sortedScores.first; }