better positioning, fixed endless workout
parent
9eff2ad177
commit
da7c820dbd
|
@ -67,6 +67,7 @@ class WorkoutProvider extends ChangeNotifier {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
_audioPlayer.play(_finishedSoundSource);
|
_audioPlayer.play(_finishedSoundSource);
|
||||||
|
stopWorkout();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,10 +23,26 @@ class WorkoutTimerWidget extends StatelessWidget {
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Text(workoutProvider.currentPhase),
|
Text(workoutProvider.currentPhase),
|
||||||
CircularProgressIndicator(
|
const SizedBox(
|
||||||
value: timerProvider.elapsedSeconds /
|
height: 20,
|
||||||
workoutProvider.currentPhaseDuration.inSeconds),
|
),
|
||||||
TimerWidget(duration: workoutProvider.currentPhaseDuration),
|
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(
|
ElevatedButton(
|
||||||
onPressed: !workoutProvider.isWorkoutStarted
|
onPressed: !workoutProvider.isWorkoutStarted
|
||||||
? () => workoutProvider.startWorkout()
|
? () => workoutProvider.startWorkout()
|
||||||
|
|
Loading…
Reference in New Issue