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:
@ -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
|
||||
|
||||
Reference in New Issue
Block a user