feat(ui): compteur de série visible pendant l'exécution (ticket #34)
Affiche le compteur de série en cours sur workout_execution_screen.dart. flutter analyze propre, 58/58 tests verts, build APK debug validé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -124,6 +124,11 @@ final class _WorkoutExecutionScreenState extends State<WorkoutExecutionScreen> {
|
||||
progressLabel: _plan.progressLabel(_position),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_SeriesCounterCard(
|
||||
currentSet: _position.setIndex + 1,
|
||||
totalSets: _exercise.setsCount,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
Text(_exercise.name, style: Theme.of(context).textTheme.headlineMedium),
|
||||
const SizedBox(height: 16),
|
||||
SetMeasureInput(
|
||||
@ -168,10 +173,15 @@ final class _WorkoutExecutionScreenState extends State<WorkoutExecutionScreen> {
|
||||
),
|
||||
if (next != null && nextExercise != null) ...[
|
||||
const SizedBox(height: 24),
|
||||
Text('Ensuite : ${nextExercise.name}', textAlign: TextAlign.center),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
'Ensuite : ${nextExercise.name} · '
|
||||
'Série ${next.setIndex + 1}/${nextExercise.setsCount}',
|
||||
'Série ${next.setIndex + 1} / ${nextExercise.setsCount}',
|
||||
textAlign: TextAlign.center,
|
||||
style: Theme.of(context).textTheme.displaySmall?.copyWith(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
fontSize: 30,
|
||||
),
|
||||
),
|
||||
],
|
||||
const Spacer(),
|
||||
@ -1304,10 +1314,8 @@ final class WorkoutExecutionPlan {
|
||||
|
||||
String progressLabel(ExecutionPosition position) {
|
||||
final program = programAt(position);
|
||||
final exercise = exerciseAt(position);
|
||||
return 'Programme ${position.programIndex + 1}/${programs.length} · '
|
||||
'Exercice ${position.exerciseIndex + 1}/${program.exercises.length} · '
|
||||
'Série ${position.setIndex + 1}/${exercise.setsCount}';
|
||||
'Exercice ${position.exerciseIndex + 1}/${program.exercises.length}';
|
||||
}
|
||||
}
|
||||
|
||||
@ -1463,6 +1471,42 @@ final class _Header extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
final class _SeriesCounterCard extends StatelessWidget {
|
||||
const _SeriesCounterCard({required this.currentSet, required this.totalSets});
|
||||
|
||||
final int currentSet;
|
||||
final int totalSets;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final tokens = courtBlazerTokensOf(context);
|
||||
return CourtBlazerAccentPanel(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'SÉRIE',
|
||||
style: theme.textTheme.labelSmall?.copyWith(
|
||||
color: tokens.mutedText,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Text(
|
||||
'$currentSet / $totalSets',
|
||||
style: theme.textTheme.displayLarge?.copyWith(
|
||||
color: theme.colorScheme.primary,
|
||||
fontSize: 48,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
String _formatDuration(Duration duration) {
|
||||
final minutes = duration.inMinutes.remainder(60).toString().padLeft(2, '0');
|
||||
final seconds = duration.inSeconds.remainder(60).toString().padLeft(2, '0');
|
||||
|
||||
Reference in New Issue
Block a user