Bearbeiten und Löschen von Matches #171

Merged
sneeex merged 64 commits from feature/120-bearbeiten-und-loeschen-von-matches into development 2026-03-08 08:28:10 +00:00
2 changed files with 8 additions and 8 deletions
Showing only changes of commit 27c6d8b293 - Show all commits

View File

@@ -58,7 +58,7 @@ class _MatchViewState extends State<MatchView> {
void initState() { void initState() {
super.initState(); super.initState();
db = Provider.of<AppDatabase>(context, listen: false); db = Provider.of<AppDatabase>(context, listen: false);
loadGames(); loadMatches();
} }
@override @override
@@ -100,7 +100,7 @@ class _MatchViewState extends State<MatchView> {
adaptivePageRoute( adaptivePageRoute(
builder: (context) => MatchDetailView( builder: (context) => MatchDetailView(
match: matches[index], match: matches[index],
onMatchUpdate: loadGames, onMatchUpdate: loadMatches,
), ),
), ),
); );
@@ -123,7 +123,7 @@ class _MatchViewState extends State<MatchView> {
context, context,
adaptivePageRoute( adaptivePageRoute(
builder: (context) => builder: (context) =>
CreateMatchView(onWinnerChanged: loadGames), CreateMatchView(onWinnerChanged: loadMatches),
), ),
); );
}, },
@@ -134,8 +134,8 @@ class _MatchViewState extends State<MatchView> {
); );
} }
/// Loads the games from the database and sorts them by creation date. /// Loads the matches from the database and sorts them by creation date.
void loadGames() { void loadMatches() {
isLoading = true; isLoading = true;
Future.wait([ Future.wait([
db.matchDao.getAllMatches(), db.matchDao.getAllMatches(),

View File

@@ -43,9 +43,9 @@ class _MatchTileState extends State<MatchTile> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final match = widget.match; final match = widget.match;
final group = widget.match.group; final group = match.group;
final winner = widget.match.winner; final winner = match.winner;
final players = [...widget.match.players] final players = [...match.players]
..sort((a, b) => a.name.compareTo(b.name)); ..sort((a, b) => a.name.compareTo(b.name));
final loc = AppLocalizations.of(context); final loc = AppLocalizations.of(context);