Added delays in constants.dart
This commit is contained in:
@@ -19,4 +19,13 @@ class Constants {
|
|||||||
remindDays: 45,
|
remindDays: 45,
|
||||||
minLaunches: 15,
|
minLaunches: 15,
|
||||||
remindLaunches: 40);
|
remindLaunches: 40);
|
||||||
|
|
||||||
|
/// Delay in milliseconds before a pop-up appears.
|
||||||
|
static const int popUpDelay = 300;
|
||||||
|
|
||||||
|
/// Delay in milliseconds before the round view appears after the previous one is closed.
|
||||||
|
static const int roundViewDelay = 600;
|
||||||
|
|
||||||
|
/// Duration in milliseconds for the fade-in animation of texts.
|
||||||
|
static const int fadeInDuration = 300;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cabo_counter/core/constants.dart';
|
||||||
import 'package:cabo_counter/core/custom_theme.dart';
|
import 'package:cabo_counter/core/custom_theme.dart';
|
||||||
import 'package:cabo_counter/data/game_manager.dart';
|
import 'package:cabo_counter/data/game_manager.dart';
|
||||||
import 'package:cabo_counter/data/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
@@ -474,7 +475,7 @@ class _ActiveGameViewState extends State<ActiveGameView> {
|
|||||||
|
|
||||||
confettiController.play();
|
confettiController.play();
|
||||||
|
|
||||||
await Future.delayed(const Duration(milliseconds: 300));
|
await Future.delayed(const Duration(milliseconds: Constants.popUpDelay));
|
||||||
|
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
showCupertinoDialog(
|
showCupertinoDialog(
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import 'package:cabo_counter/core/constants.dart';
|
||||||
import 'package:cabo_counter/core/custom_theme.dart';
|
import 'package:cabo_counter/core/custom_theme.dart';
|
||||||
import 'package:cabo_counter/data/game_manager.dart';
|
import 'package:cabo_counter/data/game_manager.dart';
|
||||||
import 'package:cabo_counter/data/game_session.dart';
|
import 'package:cabo_counter/data/game_session.dart';
|
||||||
@@ -187,7 +188,8 @@ class _CreateGameViewState extends State<CreateGameView> {
|
|||||||
opacity: _playerNameTextControllers.length > 1
|
opacity: _playerNameTextControllers.length > 1
|
||||||
? 1.0
|
? 1.0
|
||||||
: 0.0,
|
: 0.0,
|
||||||
duration: const Duration(milliseconds: 300),
|
duration: const Duration(
|
||||||
|
milliseconds: Constants.fadeInDuration),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.only(right: 8.0),
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
child: ReorderableDragStartListener(
|
child: ReorderableDragStartListener(
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ class _MainMenuViewState extends State<MainMenuView> {
|
|||||||
BadRatingDialogDecision badRatingDecision = BadRatingDialogDecision.cancel;
|
BadRatingDialogDecision badRatingDecision = BadRatingDialogDecision.cancel;
|
||||||
|
|
||||||
// so that the bad rating dialog is not shown immediately
|
// so that the bad rating dialog is not shown immediately
|
||||||
await Future.delayed(const Duration(milliseconds: 300));
|
await Future.delayed(const Duration(milliseconds: Constants.popUpDelay));
|
||||||
|
|
||||||
switch (preRatingDecision) {
|
switch (preRatingDecision) {
|
||||||
case PreRatingDialogDecision.yes:
|
case PreRatingDialogDecision.yes:
|
||||||
|
|||||||
Reference in New Issue
Block a user