From 694cac7f265063128e56d5c94b0299cfab646cd8 Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Sun, 23 Nov 2025 21:16:13 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Fix=20bug=20where=20the=20skeleton=20was=20?= =?UTF-8?q?edited=20while=20it=20was=20visible=20and=20match=20the=20?= =?UTF-8?q?=E2=80=9Cno=20games=20available=E2=80=9D=20container=20size=20t?= =?UTF-8?q?o=20the=20size=20used=20when=20games=20are=20available.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/presentation/views/main_menu/home_view.dart | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/presentation/views/main_menu/home_view.dart b/lib/presentation/views/main_menu/home_view.dart index d9cd1ab..f75eb78 100644 --- a/lib/presentation/views/main_menu/home_view.dart +++ b/lib/presentation/views/main_menu/home_view.dart @@ -151,15 +151,6 @@ class _HomeViewState extends State { ), ); } - if (snapshot.connectionState == - ConnectionState.done && - (!snapshot.hasData || - snapshot.data!.isEmpty)) { - return const Center( - heightFactor: 4, - child: Text('No recent games available.'), - ); - } final List games = (isLoading ? skeletonData @@ -214,7 +205,7 @@ class _HomeViewState extends State { ); } else { return const Center( - heightFactor: 4, + heightFactor: 12, child: Text('No recent games available.'), ); } From 974d6e9b56ce94764004d941954e14f973a84dfe Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Sun, 23 Nov 2025 22:14:13 +0100 Subject: [PATCH 2/2] refactor empty state logic in CreateGroupView The diff introduces boolean variables `doneLoading` and `snapshotDataEmpty` to simplify the conditional check for displaying the empty state message. It specifically fixes the logic to correctly show the "No players found" message when both the snapshot and the local `allPlayers` list are empty, removing the dependency on `selectedPlayers.isEmpty`. --- .../views/main_menu/create_group_view.dart | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/presentation/views/main_menu/create_group_view.dart b/lib/presentation/views/main_menu/create_group_view.dart index 59f72ed..c01250b 100644 --- a/lib/presentation/views/main_menu/create_group_view.dart +++ b/lib/presentation/views/main_menu/create_group_view.dart @@ -209,12 +209,13 @@ class _CreateGroupViewState extends State { ), ); } - if (snapshot.connectionState == - ConnectionState.done && - (!snapshot.hasData || - snapshot.data!.isEmpty || - (selectedPlayers.isEmpty && - allPlayers.isEmpty))) { + bool doneLoading = + snapshot.connectionState == + ConnectionState.done; + bool snapshotDataEmpty = + !snapshot.hasData || snapshot.data!.isEmpty; + if (doneLoading && + (snapshotDataEmpty && allPlayers.isEmpty)) { return const Center( child: TopCenteredMessage( icon: Icons.info,