Small corrections

This commit is contained in:
2026-03-07 21:57:51 +01:00
parent 0822039a5f
commit 27c6d8b293
2 changed files with 8 additions and 8 deletions

View File

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

View File

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