Compare commits

..

5 Commits
1.0.0 ... main

Author SHA1 Message Date
Digital Studium 650d085c13 Fix readme 2023-10-08 14:25:24 +03:00
Digital Studium b904fef3f5 Change default durations 2023-10-08 14:22:13 +03:00
Digital Studium ccae077e14 Fix it 2023-05-14 17:09:02 +03:00
Digital Studium 5e45dfac34 Fix it 2023-05-14 17:08:16 +03:00
Digital Studium 45ab1aa2e4 Fix all 2023-05-14 16:54:15 +03:00
4 changed files with 24 additions and 28 deletions

View File

@ -1,16 +1,12 @@
# yoga_timer
A new Flutter project.
Содержит два вида таймера: для занятий крия йогой и универсальный интервальный таймер.
Скачать можно здесь: https://git.digitalstudium.com/digitalstudium/yoga_timer/releases/download/1.0.0/app-release.apk
## Getting Started
## Компиляция
```
flutter build apk
```
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
For help getting started with Flutter development, view the
[online documentation](https://docs.flutter.dev/), which offers tutorials,
samples, guidance on mobile development, and a full API reference.
В результате появится файл `build/app/outputs/apk/release/app-release.apk`, который можно скачать на
Android-смартфон и установить.

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, seconds: 15);
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: 2);
Duration shavasanaDuration = const Duration(minutes: 5);
late int exNumber = 10;
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;
});
},