From 2c4cef76d8fb0e8fe96ecd6b7213fd1235467500 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 9 Jan 2026 23:55:29 +0100 Subject: [PATCH] Reimplemented info tile & match tile into it --- .../views/main_menu/home_view.dart | 80 ++++++++++--------- pubspec.yaml | 2 +- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/lib/presentation/views/main_menu/home_view.dart b/lib/presentation/views/main_menu/home_view.dart index c9825c8..118c0e1 100644 --- a/lib/presentation/views/main_menu/home_view.dart +++ b/lib/presentation/views/main_menu/home_view.dart @@ -34,7 +34,7 @@ class _HomeViewState extends State { /// Recent matches to display, initially filled with skeleton matches List recentMatches = List.filled( - 2, + 3, Match( name: 'Skeleton Match', group: Group( @@ -44,7 +44,6 @@ class _HomeViewState extends State { Player(name: 'Skeleton Player 2'), ], ), - winner: Player(name: 'Skeleton Player 1'), ), ); @@ -86,44 +85,46 @@ class _HomeViewState extends State { ), ], ), - if (recentMatches.isNotEmpty) - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: MatchTile( - compact: true, - width: constraints.maxWidth * 0.95, - match: recentMatches[0], - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - fullscreenDialog: true, - builder: (context) => - MatchResultView(match: recentMatches[0]), - ), - ); - }, - ), - ), - if (recentMatches.length > 1) - Padding( - padding: const EdgeInsets.only(top: 8.0), - child: MatchTile( - compact: true, - width: constraints.maxWidth * 0.95, - match: recentMatches[1], - onTap: () { - Navigator.of(context).push( - MaterialPageRoute( - fullscreenDialog: true, - builder: (context) => - MatchResultView(match: recentMatches[1]), - ), - ); - }, - ), - ), Padding( - padding: const EdgeInsets.only(top: 8.0), + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: InfoTile( + width: constraints.maxWidth * 0.95, + title: loc.recent_matches, + icon: Icons.history_rounded, + content: Column( + children: [ + if (recentMatches.isNotEmpty) + for (Match match in recentMatches) + Padding( + padding: const EdgeInsets.symmetric( + vertical: 6.0, + ), + child: MatchTile( + compact: true, + width: constraints.maxWidth * 0.9, + match: match, + onTap: () { + Navigator.of(context).push( + MaterialPageRoute( + fullscreenDialog: true, + builder: (context) => + MatchResultView(match: match), + ), + ); + }, + ), + ) + else + Center( + heightFactor: 5, + child: Text(loc.no_recent_matches_available), + ), + ], + ), + ), + ), + Padding( + padding: EdgeInsets.zero, child: InfoTile( width: constraints.maxWidth * 0.95, title: loc.quick_create, @@ -173,6 +174,7 @@ class _HomeViewState extends State { ), ), ), + SizedBox(height: MediaQuery.paddingOf(context).bottom), ], ), ), diff --git a/pubspec.yaml b/pubspec.yaml index 5887957..2474f78 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: game_tracker description: "Game Tracking App for Card Games" publish_to: 'none' -version: 0.0.2+47 +version: 0.0.2+57 environment: sdk: ^3.8.1