From 3090af9e5cfcc90909fec4073d21c6460018fc2a Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 20 Jul 2025 23:58:09 +0200 Subject: [PATCH] Centered the add player button and made it wider --- lib/presentation/views/create_game_view.dart | 70 ++++++++++++-------- 1 file changed, 42 insertions(+), 28 deletions(-) diff --git a/lib/presentation/views/create_game_view.dart b/lib/presentation/views/create_game_view.dart index 94f7c3a..5f9dbf0 100644 --- a/lib/presentation/views/create_game_view.dart +++ b/lib/presentation/views/create_game_view.dart @@ -207,38 +207,52 @@ class _CreateGameViewState extends State { }), Padding( padding: const EdgeInsets.fromLTRB(8, 0, 8, 50), - child: Center( - child: SizedBox( - width: double.infinity, - child: CupertinoButton( - padding: const EdgeInsets.symmetric(horizontal: 16), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - AppLocalizations.of(context).add_player, - style: TextStyle(color: CustomTheme.primaryColor), - ), - const SizedBox(width: 8), - Icon( - CupertinoIcons.add_circled_solid, + child: Stack( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + CupertinoButton( + padding: EdgeInsets.zero, + onPressed: null, + child: Icon( + CupertinoIcons.plus_circle_fill, color: CustomTheme.primaryColor, size: 25, ), - ], - ), - onPressed: () { - if (_playerNameTextControllers.length < maxPlayers) { - setState(() { - _playerNameTextControllers - .add(TextEditingController()); - }); - } else { - _showFeedbackDialog(CreateStatus.maxPlayers); - } - }, + ), + ], ), - ), + Center( + child: CupertinoButton( + padding: const EdgeInsets.symmetric(horizontal: 0), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + child: Center( + child: Text( + AppLocalizations.of(context).add_player, + style: TextStyle( + color: CustomTheme.primaryColor), + ), + ), + ), + ], + ), + onPressed: () { + if (_playerNameTextControllers.length < maxPlayers) { + setState(() { + _playerNameTextControllers + .add(TextEditingController()); + }); + } else { + _showFeedbackDialog(CreateStatus.maxPlayers); + } + }, + ), + ), + ], ), ), Padding(