add statistics reload and fix wrong best player calculation
This commit is contained in:
@@ -191,7 +191,13 @@ class _GroupDetailViewState extends State<GroupDetailView> {
|
|||||||
context,
|
context,
|
||||||
adaptivePageRoute(
|
adaptivePageRoute(
|
||||||
builder: (context) {
|
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
|
// Count wins for each player
|
||||||
for (var match in matches) {
|
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(
|
bestPlayerCounts.update(
|
||||||
match.winner!,
|
match.winner!,
|
||||||
(value) => value + 1,
|
(value) => value + 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user