Skip to content

Commit

Permalink
add sort highscore
Browse files Browse the repository at this point in the history
  • Loading branch information
zalviandyr committed Sep 29, 2021
1 parent 6e0538e commit 7cbae7e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/blocs/player_score_bloc.dart
Expand Up @@ -21,6 +21,8 @@ class PlayerScoreBloc extends Bloc<PlayerScoreEvent, PlayerScoreState> {
users.add(User.fromMap(data.value));
}

users.sort((a, b) => b.highScore.compareTo(a.highScore));

yield PlayerScoreFetchSuccess(users: users);
}
} catch (error) {
Expand Down

0 comments on commit 7cbae7e

Please sign in to comment.