diff --git a/lib/presentation/views/main_menu/create_game/create_game_view.dart b/lib/presentation/views/main_menu/create_game/create_game_view.dart index 8b3271c..b9a8141 100644 --- a/lib/presentation/views/main_menu/create_game/create_game_view.dart +++ b/lib/presentation/views/main_menu/create_game/create_game_view.dart @@ -126,6 +126,11 @@ class _CreateGameViewState extends State { child: TextInputField( controller: _gameNameController, hintText: 'Game name', + onChanged: (value) { + setState(() { + _gameNameController; + }); + }, ), ), ChooseTile( @@ -144,7 +149,6 @@ class _CreateGameViewState extends State { ); setState(() { if (selectedGameIndex != -1) { - print('selectedGameIndex: $selectedGameIndex'); selectedRuleset = games[selectedGameIndex].$3; selectedRulesetIndex = rulesets.indexWhere( (r) => r.$1 == selectedRuleset, @@ -251,9 +255,12 @@ class _CreateGameViewState extends State { /// Determines whether the "Create Game" button should be enabled based on /// the current state of the input fields. bool _enableCreateGameButton() { - return _gameNameController.text.isNotEmpty && + final value = + _gameNameController.text.isNotEmpty && (selectedGroup != null || (selectedPlayers != null && selectedPlayers!.length > 1)) && selectedRuleset != null; + print('button: $value'); + return value; } }