Fixed info message placement
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m19s
Pull Request Pipeline / lint (pull_request) Successful in 2m21s

This commit is contained in:
2025-12-31 16:38:09 +01:00
parent 0567fce02b
commit bfca41bd36

View File

@@ -128,34 +128,48 @@ class _PlayerSelectionState extends State<PlayerSelection> {
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
Wrap( SizedBox(
alignment: WrapAlignment.start, height: 50,
crossAxisAlignment: WrapCrossAlignment.start, child: selectedPlayers.isEmpty
spacing: 8.0, ? const Center(
runSpacing: 8.0, child: Text(
children: <Widget>[ 'No players selected',
// Generates a TextIconTile for each selected player. style: TextStyle(color: Colors.grey),
),
)
: SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: [
for (var player in selectedPlayers) for (var player in selectedPlayers)
TextIconTile( Padding(
padding: const EdgeInsets.only(right: 8.0),
child: TextIconTile(
text: player.name, text: player.name,
onIconTap: () { onIconTap: () {
setState(() { setState(() {
// Removes the player from the selection and notifies the parent. // Removes the player from the selection and notifies the parent.
final currentSearch = _searchBarController.text final currentSearch = _searchBarController
.text
.toLowerCase(); .toLowerCase();
selectedPlayers.remove(player); selectedPlayers.remove(player);
widget.onChanged([...selectedPlayers]); widget.onChanged([...selectedPlayers]);
// If the player matches the current search query (or search is empty), // If the player matches the current search query (or search is empty),
// they are added back to the suggestions and the list is re-sorted. // they are added back to the suggestions and the list is re-sorted.
if (currentSearch.isEmpty || if (currentSearch.isEmpty ||
player.name.toLowerCase().contains(currentSearch)) { player.name.toLowerCase().contains(
currentSearch,
)) {
suggestedPlayers.add(player); suggestedPlayers.add(player);
} }
}); });
}, },
), ),
),
], ],
), ),
),
),
const SizedBox(height: 10), const SizedBox(height: 10),
const Text( const Text(
'All players:', 'All players:',