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,33 +128,47 @@ 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),
for (var player in selectedPlayers) ),
TextIconTile( )
text: player.name, : SingleChildScrollView(
onIconTap: () { scrollDirection: Axis.horizontal,
setState(() { child: Row(
// Removes the player from the selection and notifies the parent. children: [
final currentSearch = _searchBarController.text for (var player in selectedPlayers)
.toLowerCase(); Padding(
selectedPlayers.remove(player); padding: const EdgeInsets.only(right: 8.0),
widget.onChanged([...selectedPlayers]); child: TextIconTile(
// If the player matches the current search query (or search is empty), text: player.name,
// they are added back to the suggestions and the list is re-sorted. onIconTap: () {
if (currentSearch.isEmpty || setState(() {
player.name.toLowerCase().contains(currentSearch)) { // Removes the player from the selection and notifies the parent.
suggestedPlayers.add(player); final currentSearch = _searchBarController
} .text
}); .toLowerCase();
}, selectedPlayers.remove(player);
), widget.onChanged([...selectedPlayers]);
], // 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.
if (currentSearch.isEmpty ||
player.name.toLowerCase().contains(
currentSearch,
)) {
suggestedPlayers.add(player);
}
});
},
),
),
],
),
),
), ),
const SizedBox(height: 10), const SizedBox(height: 10),
const Text( const Text(