Small corrections
This commit is contained in:
@@ -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(),
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user