feat(ui): écran Bibliothèque d'exercices

Ajoute l'écran de bibliothèque d'exercices (presentation/exercise_library_screen.dart)
et ajuste la couche application/domaine (bootstrap, ports, use cases,
entités, repositories Drift) pour l'alimenter. flutter analyze propre,
9/9 tests verts, build APK debug validé.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-17 18:42:41 +02:00
parent f474eb500b
commit 318fc6fcb9
10 changed files with 1041 additions and 18 deletions

View File

@ -21,12 +21,28 @@ final class DriftExerciseRepository implements ExerciseRepository {
Future<List<domain.Exercise>> listActive() async {
final rows =
await (database.select(database.exercises)
..where((table) => table.deletedAt.isNull())
..where(
(table) => table.deletedAt.isNull() & table.archivedAt.isNull(),
)
..orderBy([(table) => OrderingTerm.asc(table.name)]))
.get();
return rows.map(_exerciseFromRow).toList();
}
@override
Future<bool> isReferencedByProgram(String id) async {
final row =
await (database.select(database.programExercises)
..where(
(table) =>
table.deletedAt.isNull() &
table.sourceExerciseId.equals(id),
)
..limit(1))
.getSingleOrNull();
return row != null;
}
@override
Future<void> save(domain.Exercise exercise) async {
await database