From afb7a5f1d4c18be253b15b6acb2d8187b9ae9b00 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Fri, 9 Jan 2026 20:15:50 +0100 Subject: [PATCH] MatchTiles only show when recent games are available --- .../views/main_menu/home_view.dart | 66 ++++++++++--------- pubspec.yaml | 2 +- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/lib/presentation/views/main_menu/home_view.dart b/lib/presentation/views/main_menu/home_view.dart index 6599b98..a94eae4 100644 --- a/lib/presentation/views/main_menu/home_view.dart +++ b/lib/presentation/views/main_menu/home_view.dart @@ -86,40 +86,42 @@ class _HomeViewState extends State { ), ], ), - 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.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]), + ), + ); + }, + ), ), - ), - 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]), - ), - ); - }, + 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.symmetric(vertical: 16.0), child: InfoTile( diff --git a/pubspec.yaml b/pubspec.yaml index 993ef78..835cabf 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.1+23 +version: 0.0.1+43 environment: sdk: ^3.8.1