Added named parameter
This commit is contained in:
@@ -46,6 +46,9 @@ class _CreateGameViewState extends State<CreateGameView> {
|
|||||||
/// Maximum number of players allowed in the game.
|
/// Maximum number of players allowed in the game.
|
||||||
final int maxPlayers = 5;
|
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.
|
/// Variable to hold the selected game mode.
|
||||||
late GameMode gameMode;
|
late GameMode gameMode;
|
||||||
|
|
||||||
@@ -152,8 +155,7 @@ class _CreateGameViewState extends State<CreateGameView> {
|
|||||||
},
|
},
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
return Padding(
|
return Padding(
|
||||||
key: ValueKey(
|
key: UniqueKey(),
|
||||||
'player_${_playerNameTextControllers[index].hashCode}'),
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
padding: const EdgeInsets.symmetric(vertical: 8.0),
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -257,7 +259,8 @@ class _CreateGameViewState extends State<CreateGameView> {
|
|||||||
KeyboardVisibilityBuilder(builder: (context, visible) {
|
KeyboardVisibilityBuilder(builder: (context, visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
height: MediaQuery.of(context).viewInsets.bottom * 0.75,
|
height: MediaQuery.of(context).viewInsets.bottom *
|
||||||
|
keyboardHeightAdjustmentFactor,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
return const SizedBox.shrink();
|
return const SizedBox.shrink();
|
||||||
|
|||||||
Reference in New Issue
Block a user