Moved dao methods

This commit is contained in:
2026-04-08 23:22:33 +02:00
parent e10f05adb5
commit 855b7c8bea
8 changed files with 155 additions and 148 deletions

View File

@@ -139,11 +139,11 @@ class _MatchResultViewState extends State<MatchResultView> {
/// based on the current selection.
Future<void> _handleWinnerSaving() async {
if (_selectedPlayer == null) {
await db.matchDao.removeWinner(matchId: widget.match.id);
await db.scoreDao.removeWinner(matchId: widget.match.id);
} else {
await db.matchDao.setWinner(
await db.scoreDao.setWinner(
matchId: widget.match.id,
winnerId: _selectedPlayer!.id,
playerId: _selectedPlayer!.id,
);
}
widget.onWinnerChanged?.call();