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 # 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
```
В результате появится файл `build/app/outputs/apk/release/app-release.apk`, который можно скачать на This project is a starting point for a Flutter application.
Android-смартфон и установить.
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') project.evaluationDependsOn(':app')
} }
tasks.register("clean", Delete) { task clean(type: Delete) {
delete rootProject.buildDir delete rootProject.buildDir
} }

View File

@ -13,7 +13,7 @@ class KriyaPage extends StatefulWidget {
} }
class _KriyaPageState extends State<KriyaPage> { 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); Duration shavasanaDuration = const Duration(minutes: 7);
late int exNumber = 38; late int exNumber = 38;
late int totalDuration = late int totalDuration =

View File

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