Fehlende Info in CreateGroupView #107

Merged
sneeex merged 3 commits from bug/73-Fehlende-Info-in-CreateGroupView into development 2025-12-31 16:24:32 +00:00
Showing only changes of commit bfca41bd36 - Show all commits

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(