From 88f17fda6a77b45cf098e50226450911ee6ddc08 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 20 Jul 2025 20:50:57 +0200 Subject: [PATCH] Added named parameter --- lib/presentation/views/create_game_view.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/presentation/views/create_game_view.dart b/lib/presentation/views/create_game_view.dart index a1b5894..5148537 100644 --- a/lib/presentation/views/create_game_view.dart +++ b/lib/presentation/views/create_game_view.dart @@ -46,6 +46,9 @@ class _CreateGameViewState extends State { /// Maximum number of players allowed in the game. final int maxPlayers = 5; + /// Factor to adjust the view length when the keyboard is visible. + final double keyboardHeightAdjustmentFactor = 0.75; + /// Variable to hold the selected game mode. late GameMode gameMode; @@ -152,8 +155,7 @@ class _CreateGameViewState extends State { }, itemBuilder: (context, index) { return Padding( - key: ValueKey( - 'player_${_playerNameTextControllers[index].hashCode}'), + key: UniqueKey(), padding: const EdgeInsets.symmetric(vertical: 8.0), child: Row( children: [ @@ -257,7 +259,8 @@ class _CreateGameViewState extends State { KeyboardVisibilityBuilder(builder: (context, visible) { if (visible) { return SizedBox( - height: MediaQuery.of(context).viewInsets.bottom * 0.75, + height: MediaQuery.of(context).viewInsets.bottom * + keyboardHeightAdjustmentFactor, ); } else { return const SizedBox.shrink();