require full teams for bracket initialization

This commit is contained in:
2026-03-13 15:04:17 +01:00
parent cc7faf477b
commit 95897ccc07
6 changed files with 40 additions and 22 deletions

View File

@@ -70,10 +70,7 @@ class _HomePageState extends State<HomePage> {
const PopupMenuItem(value: 1, child: Text('Profil')),
const PopupMenuItem(
value: 2,
child: Text(
'Abmelden',
style: TextStyle(color: Colors.red),
),
child: Text('Abmelden', style: TextStyle(color: Colors.red)),
),
];
},

View File

@@ -158,15 +158,17 @@ class _TournamentBracketPageState extends State<TournamentBracketPage> {
),
const SizedBox(height: 16),
ElevatedButton(
onPressed: teams.length >= 2 ? _initializeBracket : null,
onPressed: teams.length >= widget.tournament.maxTeamAmount
? _initializeBracket
: null,
child: const Text('Turnierbaum initialisieren'),
),
if (teams.length < 2)
const Padding(
padding: EdgeInsets.only(top: 8),
if (teams.length < widget.tournament.maxTeamAmount)
Padding(
padding: const EdgeInsets.only(top: 8),
child: Text(
'Mindestens 2 Teams erforderlich',
style: TextStyle(color: Colors.red),
'${teams.length}/${widget.tournament.maxTeamAmount} Teams angemeldet',
style: const TextStyle(color: Colors.red),
),
),
],