Skip to content

Commit

Permalink
Merge pull request #192 from a-mabe/190-featureimprovement-keep-scree…
Browse files Browse the repository at this point in the history
…n-on

190 featureimprovement keep screen on
  • Loading branch information
a-mabe authored Jan 4, 2025
2 parents f18965e + 19bbf4f commit 013263b
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 77 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# OpenHIIT

![Integration Tests](https://github.com/a-mabe/openhiit/actions/workflows/test.yaml/badge.svg)
![Release Build](https://github.com/a-mabe/openhiit/actions/workflows/build_and_release.yaml/badge.svg)
![Integration Tests](https://github.com/a-mabe/openhiit/actions/workflows/integration_tests.yaml/badge.svg)
![Nightly Build](https://github.com/a-mabe/openhiit/actions/workflows/nightly_build.yaml/badge.svg)
![Pre-Release](https://github.com/a-mabe/openhiit/actions/workflows/pre_release.yaml/badge.svg)
![Release](https://github.com/a-mabe/openhiit/actions/workflows/release.yaml/badge.svg)

<p align="center">
<img src="./assets/icon/openhiit-ios.png" width="150"/>
Expand Down
4 changes: 4 additions & 0 deletions lib/pages/active_timer/workout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import 'package:openhiit/pages/active_timer/widgets/timer_complete.dart';
import 'package:openhiit/utils/functions.dart';
import 'package:openhiit/widgets/timer_card_item_animated.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:wakelock_plus/wakelock_plus.dart';

class RunTimer extends StatefulWidget {
final TimerType timer;
Expand Down Expand Up @@ -63,6 +64,7 @@ class RunTimerState extends State<RunTimer> {
@override
void dispose() {
_controllerCenter.dispose();
WakelockPlus.disable();
super.dispose();
}

Expand Down Expand Up @@ -119,6 +121,7 @@ class RunTimerState extends State<RunTimer> {
_paused = !_paused;
});
_paused ? _controller.pause() : _controller.resume();
_paused ? WakelockPlus.disable() : WakelockPlus.enable();
}

Color backgroundColor(String state) {
Expand All @@ -145,6 +148,7 @@ class RunTimerState extends State<RunTimer> {
SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
statusBarBrightness: Brightness.dark,
));
WakelockPlus.enable();
return Scaffold(body: OrientationBuilder(builder: (context, orientation) {
return Countdown(
controller: _controller,
Expand Down
Loading

0 comments on commit 013263b

Please sign in to comment.