Trim whitespace from group and player names in CreateGroupView
All checks were successful
Pull Request Pipeline / test (pull_request) Successful in 2m7s
Pull Request Pipeline / lint (pull_request) Successful in 2m7s

This commit is contained in:
2025-11-20 21:26:59 +01:00
parent 8ff3c01435
commit 0111774308

View File

@@ -107,7 +107,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
trailingButtonEnabled: trailingButtonEnabled:
_searchBarController.text.isNotEmpty, _searchBarController.text.isNotEmpty,
onTrailingButtonPressed: () async { onTrailingButtonPressed: () async {
String playerName = _searchBarController.text; String playerName = _searchBarController.text.trim();
if (playerName.isEmpty) return; if (playerName.isEmpty) return;
bool success = await db.playerDao.addPlayer( bool success = await db.playerDao.addPlayer(
player: Player(name: playerName), player: Player(name: playerName),
@@ -314,7 +314,7 @@ class _CreateGroupViewState extends State<CreateGroupView> {
: () async { : () async {
bool success = await db.groupDao.addGroup( bool success = await db.groupDao.addGroup(
group: Group( group: Group(
name: _groupNameController.text, name: _groupNameController.text.trim(),
members: selectedPlayers, members: selectedPlayers,
), ),
); );