feat(bibliothèque): badge Exemple, catégories et états vides bibliothèque (ticket #80)
Ajoute le badge "Exemple" (example_badge.dart) affiché sur les exercices/programmes/séances-modèles seedés, le filtrage par catégorie dans la bibliothèque d'exercices et les états vides dédiés. Préserve isExample lors de l'édition d'un programme ou d'une séance-modèle existants (ProgramUseCases/WorkoutTemplateUseCases). Validé GO par Main : dart analyze propre, 173 tests (4 échecs préexistants sans rapport avec ce lot). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../application/application.dart';
|
||||
import '../domain/domain.dart';
|
||||
import 'example_badge.dart';
|
||||
import 'exercise_library_screen.dart';
|
||||
import 'share_screen.dart';
|
||||
|
||||
@ -61,9 +62,8 @@ final class _ProgramListScreenState extends State<ProgramListScreen> {
|
||||
final programs = snapshot.data ?? const <Program>[];
|
||||
if (programs.isEmpty) {
|
||||
return _CenteredMessage(
|
||||
title: 'Aucun programme pour le moment',
|
||||
message:
|
||||
'Crée un programme pour organiser tes exercices en séries.',
|
||||
title: 'Aucun programme',
|
||||
message: 'Assemble quelques exercices pour préparer une séance.',
|
||||
actionLabel: 'Créer un programme',
|
||||
onAction: () => _openForm(),
|
||||
);
|
||||
@ -74,7 +74,15 @@ final class _ProgramListScreenState extends State<ProgramListScreen> {
|
||||
itemBuilder: (context, index) {
|
||||
final program = programs[index];
|
||||
return ListTile(
|
||||
title: Text(program.name),
|
||||
title: Wrap(
|
||||
spacing: 8,
|
||||
runSpacing: 4,
|
||||
crossAxisAlignment: WrapCrossAlignment.center,
|
||||
children: [
|
||||
Text(program.name),
|
||||
if (program.isExample) const ExampleBadge(),
|
||||
],
|
||||
),
|
||||
subtitle: Text(_programSummary(program)),
|
||||
trailing: Wrap(
|
||||
spacing: 8,
|
||||
|
||||
Reference in New Issue
Block a user