better positioning, fixed endless workout

main
Julian Gegner 2023-03-01 12:57:02 +01:00
parent 9eff2ad177
commit da7c820dbd
2 changed files with 21 additions and 4 deletions

View File

@ -67,6 +67,7 @@ class WorkoutProvider extends ChangeNotifier {
});
} else {
_audioPlayer.play(_finishedSoundSource);
stopWorkout();
}
}

View File

@ -23,10 +23,26 @@ class WorkoutTimerWidget extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(workoutProvider.currentPhase),
CircularProgressIndicator(
value: timerProvider.elapsedSeconds /
workoutProvider.currentPhaseDuration.inSeconds),
const SizedBox(
height: 20,
),
Stack(
alignment: Alignment.center,
children: [
SizedBox(
height: 100,
width: 100,
child: CircularProgressIndicator(
value: (workoutProvider.currentPhaseDuration.inSeconds
.toDouble() -
timerProvider.elapsedSeconds) /
workoutProvider.currentPhaseDuration.inSeconds)),
TimerWidget(duration: workoutProvider.currentPhaseDuration),
],
),
const SizedBox(
height: 20,
),
ElevatedButton(
onPressed: !workoutProvider.isWorkoutStarted
? () => workoutProvider.startWorkout()