add statistics reload and fix wrong best player calculation

This commit is contained in:
2026-03-09 15:28:37 +01:00
parent 6c50eaefc7
commit 840faab024

View File

@@ -191,7 +191,13 @@ class _GroupDetailViewState extends State<GroupDetailView> {
context,
adaptivePageRoute(
builder: (context) {
return CreateGroupView(groupToEdit: _group);
return CreateGroupView(
groupToEdit: _group,
onMembersChanged: () {
isLoading = true;
_loadStatistics();
},
);
},
),
);
@@ -260,7 +266,9 @@ class _GroupDetailViewState extends State<GroupDetailView> {
// Count wins for each player
for (var match in matches) {
if (match.winner != null) {
if (match.winner != null &&
_group.members.any((m) => m.id == match.winner?.id)) {
print(match.winner);
bestPlayerCounts.update(
match.winner!,
(value) => value + 1,