Change default durations

This commit is contained in:
Digital Studium 2023-10-08 14:22:13 +03:00
parent ccae077e14
commit b904fef3f5
3 changed files with 16 additions and 16 deletions

View File

@ -26,6 +26,6 @@ subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}

View File

@ -13,7 +13,7 @@ class KriyaPage extends StatefulWidget {
}
class _KriyaPageState extends State<KriyaPage> {
Duration kriyaDuration = const Duration(minutes: 1);
Duration kriyaDuration = const Duration(seconds: 30);
Duration shavasanaDuration = const Duration(minutes: 7);
late int exNumber = 38;
late int totalDuration =

View File

@ -13,11 +13,11 @@ class UniversalPage extends StatefulWidget {
}
class _UniversalPageState extends State<UniversalPage> {
Duration universalDuration = const Duration(minutes: 10);
Duration shavasanaDuration = const Duration(minutes: 5);
late int exNumber = 3;
Duration exerciseDuration = const Duration(minutes: 4);
Duration shavasanaDuration = const Duration(minutes: 10);
late int exNumber = 5;
late int totalDuration =
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
late Timer _timer;
late String startText = 'Старт';
@ -25,7 +25,7 @@ class _UniversalPageState extends State<UniversalPage> {
bool isStarted() {
if (totalDuration ==
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds) {
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds) {
return false;
}
return true;
@ -54,7 +54,7 @@ class _UniversalPageState extends State<UniversalPage> {
totalDuration--;
});
} else if ((totalDuration - shavasanaDuration.inSeconds) %
universalDuration.inSeconds ==
exerciseDuration.inSeconds ==
0 &&
(totalDuration - shavasanaDuration.inSeconds) > 0) {
player.play(AssetSource('audio/start.mp3'));
@ -78,7 +78,7 @@ class _UniversalPageState extends State<UniversalPage> {
_timer.cancel();
startText = 'Старт';
totalDuration =
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
});
}
@ -86,7 +86,7 @@ class _UniversalPageState extends State<UniversalPage> {
setState(() {
exNumber = value!;
totalDuration =
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
});
}
@ -198,21 +198,21 @@ class _UniversalPageState extends State<UniversalPage> {
: () => _showDialog(
CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.ms,
initialTimerDuration: universalDuration,
initialTimerDuration: exerciseDuration,
onTimerDurationChanged: (Duration newDuration) {
setState(() {
universalDuration = newDuration;
exerciseDuration = newDuration;
totalDuration =
universalDuration.inSeconds * exNumber +
exerciseDuration.inSeconds * exNumber +
shavasanaDuration.inSeconds;
});
},
),
),
child: Text(
format(universalDuration)[1] +
format(exerciseDuration)[1] +
":" +
format(universalDuration)[2],
format(exerciseDuration)[2],
style: const TextStyle(
fontSize: 22.0,
),
@ -235,7 +235,7 @@ class _UniversalPageState extends State<UniversalPage> {
setState(() {
shavasanaDuration = newDuration;
totalDuration =
universalDuration.inSeconds * exNumber +
exerciseDuration.inSeconds * exNumber +
shavasanaDuration.inSeconds;
});
},