Compare commits

..

No commits in common. "main" and "1.0.0" have entirely different histories.
main ... 1.0.0

4 changed files with 28 additions and 24 deletions

View File

@ -1,12 +1,16 @@
# yoga_timer
Содержит два вида таймера: для занятий крия йогой и универсальный интервальный таймер.
Скачать можно здесь: https://git.digitalstudium.com/digitalstudium/yoga_timer/releases/download/1.0.0/app-release.apk
A new Flutter project.
## Компиляция
```
flutter build apk
```
## Getting Started
В результате появится файл `build/app/outputs/apk/release/app-release.apk`, который можно скачать на
Android-смартфон и установить.
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.

View File

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

View File

@ -13,7 +13,7 @@ class KriyaPage extends StatefulWidget {
}
class _KriyaPageState extends State<KriyaPage> {
Duration kriyaDuration = const Duration(seconds: 30);
Duration kriyaDuration = const Duration(minutes: 1, seconds: 15);
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 exerciseDuration = const Duration(minutes: 4);
Duration shavasanaDuration = const Duration(minutes: 10);
late int exNumber = 5;
Duration universalDuration = const Duration(minutes: 2);
Duration shavasanaDuration = const Duration(minutes: 5);
late int exNumber = 10;
late int totalDuration =
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
late Timer _timer;
late String startText = 'Старт';
@ -25,7 +25,7 @@ class _UniversalPageState extends State<UniversalPage> {
bool isStarted() {
if (totalDuration ==
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds) {
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds) {
return false;
}
return true;
@ -54,7 +54,7 @@ class _UniversalPageState extends State<UniversalPage> {
totalDuration--;
});
} else if ((totalDuration - shavasanaDuration.inSeconds) %
exerciseDuration.inSeconds ==
universalDuration.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 =
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
});
}
@ -86,7 +86,7 @@ class _UniversalPageState extends State<UniversalPage> {
setState(() {
exNumber = value!;
totalDuration =
exerciseDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
universalDuration.inSeconds * exNumber + shavasanaDuration.inSeconds;
});
}
@ -198,21 +198,21 @@ class _UniversalPageState extends State<UniversalPage> {
: () => _showDialog(
CupertinoTimerPicker(
mode: CupertinoTimerPickerMode.ms,
initialTimerDuration: exerciseDuration,
initialTimerDuration: universalDuration,
onTimerDurationChanged: (Duration newDuration) {
setState(() {
exerciseDuration = newDuration;
universalDuration = newDuration;
totalDuration =
exerciseDuration.inSeconds * exNumber +
universalDuration.inSeconds * exNumber +
shavasanaDuration.inSeconds;
});
},
),
),
child: Text(
format(exerciseDuration)[1] +
format(universalDuration)[1] +
":" +
format(exerciseDuration)[2],
format(universalDuration)[2],
style: const TextStyle(
fontSize: 22.0,
),
@ -235,7 +235,7 @@ class _UniversalPageState extends State<UniversalPage> {
setState(() {
shavasanaDuration = newDuration;
totalDuration =
exerciseDuration.inSeconds * exNumber +
universalDuration.inSeconds * exNumber +
shavasanaDuration.inSeconds;
});
},