add placeholder in carousel

This commit is contained in:
2026-03-12 11:06:46 +01:00
parent 28feaa1f01
commit 89cf876707
3 changed files with 40 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
---
description: Instructions for documenting prompts and file changes in docs/prompt.md
applyTo: 'docs/prompt.md' # Auto-apply when docs/prompt.md is involved
applyTo: '**'
---
# Writing Prompts to docs/prompt.md

View File

@@ -71,3 +71,9 @@ Folgende Dateien wurden in diesem Prompt verändert:
- Fix the carousel not reloading when the reload button is pressed or when a tournament is joined.<br><br>
Folgende Dateien wurden in diesem Prompt verändert:
- frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart
## 12.03.2026
- Show a placeholder in the carousel if no tournaments were found.<br><br>
Folgende Dateien wurden in diesem Prompt verändert:
- frontend_splatournament_manager/lib/widgets/my_tournaments_carousel.dart

View File

@@ -32,7 +32,39 @@ class _MyTournamentsCarouselState extends State<MyTournamentsCarousel> {
final tournaments = snapshot.data ?? [];
if (tournaments.isEmpty) {
return const SizedBox.shrink();
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Padding(
padding: EdgeInsets.fromLTRB(16, 16, 16, 8),
child: Text(
'My Tournaments',
style: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
),
),
SizedBox(
height: 150,
child: Card(
margin: const EdgeInsets.symmetric(horizontal: 8),
elevation: 4,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.emoji_events_outlined, size: 48, color: Colors.grey),
const SizedBox(height: 8),
const Text(
'No tournaments found',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
],
),
),
),
),
const SizedBox(height: 16),
],
);
}
return Column(