Added focus nodes for autofocus and navigation between textfields

This commit is contained in:
2025-07-21 00:07:20 +02:00
parent 7830d296c3
commit ca9d55c29b
2 changed files with 13 additions and 1 deletions

View File

@@ -188,6 +188,18 @@ class _CreateGameViewState extends State<CreateGameView> {
'${AppLocalizations.of(context).player} ${index + 1}',
padding: const EdgeInsets.all(12),
decoration: const BoxDecoration(),
textInputAction:
index + 1 < _playerNameTextControllers.length
? TextInputAction.next
: TextInputAction.done,
onSubmitted: (_) {
if (index + 1 < _playerNameFocusNodes.length) {
_playerNameFocusNodes[index + 1]
.requestFocus();
} else {
FocusScope.of(context).unfocus();
}
},
),
),
AnimatedOpacity(

View File

@@ -2,7 +2,7 @@ name: cabo_counter
description: "Mobile app for the card game Cabo"
publish_to: 'none'
version: 0.5.2+585
version: 0.5.2+586
environment:
sdk: ^3.5.4