Refactored views

This commit is contained in:
2026-01-07 13:27:39 +01:00
parent a78614851b
commit 6e45e9435b
11 changed files with 117 additions and 67 deletions

View File

@@ -28,6 +28,8 @@ class _MatchViewState extends State<MatchView> {
late final AppDatabase db;
bool isLoading = true;
/// Loaded matches from the database,
/// initially filled with skeleton matches
List<Match> matches = List.filled(
4,
Match(
@@ -44,7 +46,6 @@ class _MatchViewState extends State<MatchView> {
@override
void initState() {
super.initState();
db = Provider.of<AppDatabase>(context, listen: false);
loadGames();
}
@@ -117,6 +118,7 @@ class _MatchViewState extends State<MatchView> {
);
}
/// Loads the games from the database and sorts them by creation date.
void loadGames() {
Future.wait([
db.matchDao.getAllMatches(),