diff --git a/lib/core/constants.dart b/lib/core/constants.dart index e1c2f8d..54c2c62 100644 --- a/lib/core/constants.dart +++ b/lib/core/constants.dart @@ -21,11 +21,14 @@ class Constants { remindLaunches: 40); /// Delay in milliseconds before a pop-up appears. - static const int popUpDelay = 300; + static const int kPopUpDelay = 300; /// Delay in milliseconds before the round view appears after the previous one is closed. - static const int roundViewDelay = 600; + static const int kRoundViewDelay = 600; /// Duration in milliseconds for the fade-in animation of texts. - static const int fadeInDuration = 300; + static const int kFadeInDuration = 300; + + /// Duration in milliseconds for the keyboard to fully disappear. + static const int kKeyboardDelay = 300; } diff --git a/lib/presentation/views/active_game_view.dart b/lib/presentation/views/active_game_view.dart index ab18c76..7a957ce 100644 --- a/lib/presentation/views/active_game_view.dart +++ b/lib/presentation/views/active_game_view.dart @@ -473,7 +473,7 @@ class _ActiveGameViewState extends State { if (round != null && round >= 0) { WidgetsBinding.instance.addPostFrameCallback((_) async { await Future.delayed( - const Duration(milliseconds: Constants.roundViewDelay)); + const Duration(milliseconds: Constants.kRoundViewDelay)); if (context.mounted) { _openRoundView(context, round); } @@ -489,7 +489,7 @@ class _ActiveGameViewState extends State { confettiController.play(); - await Future.delayed(const Duration(milliseconds: Constants.popUpDelay)); + await Future.delayed(const Duration(milliseconds: Constants.kPopUpDelay)); if (context.mounted) { showCupertinoDialog( diff --git a/lib/presentation/views/create_game_view.dart b/lib/presentation/views/create_game_view.dart index a868998..22a4e2d 100644 --- a/lib/presentation/views/create_game_view.dart +++ b/lib/presentation/views/create_game_view.dart @@ -216,7 +216,7 @@ class _CreateGameViewState extends State { ? 1.0 : 0.0, duration: const Duration( - milliseconds: Constants.fadeInDuration), + milliseconds: Constants.kFadeInDuration), child: Padding( padding: const EdgeInsets.only(right: 8.0), child: ReorderableDragStartListener( @@ -289,7 +289,6 @@ class _CreateGameViewState extends State { Padding( padding: const EdgeInsets.fromLTRB(0, 0, 0, 50), child: Center( - key: const ValueKey('create_game_button'), child: CustomButton( child: Text( AppLocalizations.of(context).create_game, @@ -298,7 +297,12 @@ class _CreateGameViewState extends State { ), ), onPressed: () { - _checkAllGameAttributes(); + FocusScope.of(context).unfocus(); + Future.delayed( + const Duration( + milliseconds: Constants.kKeyboardDelay), () { + _checkAllGameAttributes(); + }); }, ), ), diff --git a/lib/presentation/views/main_menu_view.dart b/lib/presentation/views/main_menu_view.dart index 0603622..0765e14 100644 --- a/lib/presentation/views/main_menu_view.dart +++ b/lib/presentation/views/main_menu_view.dart @@ -245,7 +245,7 @@ class _MainMenuViewState extends State { BadRatingDialogDecision badRatingDecision = BadRatingDialogDecision.cancel; // so that the bad rating dialog is not shown immediately - await Future.delayed(const Duration(milliseconds: Constants.popUpDelay)); + await Future.delayed(const Duration(milliseconds: Constants.kPopUpDelay)); switch (preRatingDecision) { case PreRatingDialogDecision.yes: diff --git a/pubspec.yaml b/pubspec.yaml index df8ca8e..0873c95 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.5.5+606 +version: 0.5.4+609 environment: sdk: ^3.5.4