implement updateMatchStateAfterSave to refresh match scores
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 45s
Pull Request Pipeline / lint (pull_request) Successful in 52s

This commit is contained in:
2026-05-09 12:57:42 +02:00
parent f0062dd9d9
commit 350c5430a4

View File

@@ -205,7 +205,7 @@ class _MatchDetailViewState extends State<MatchDetailView> {
match: match,
onWinnerChanged: () {
widget.onMatchUpdate.call();
setState(() {});
updateMatchStateAfterSave();
},
),
),
@@ -230,6 +230,17 @@ class _MatchDetailViewState extends State<MatchDetailView> {
widget.onMatchUpdate.call();
}
/// Updates the match scores after saving in MatchResultView
Future<void> updateMatchStateAfterSave() async {
final scores = await db.scoreEntryDao.getAllMatchScores(matchId: match.id);
if (!mounted) return;
setState(() {
match.scores = scores;
});
}
/// Returns the widget to be displayed in the result [InfoTile]
Widget getResultWidget(AppLocalizations loc) {
if (isSingleRowResult()) {