feat(#173): feed bulles parent branché sur GET /cards

Affiche la file d’attention pastel (assets card_*_h) filtrée
par couple courant, avec accept / refus motivé / ack.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-10-01 17:10:40 +02:00
co-authored by Cursor
parent 290d442123
commit d53682110d
5 changed files with 685 additions and 10 deletions
@@ -3,14 +3,14 @@ import 'package:p_tits_pas/models/couple_garde.dart';
import 'package:p_tits_pas/models/user.dart';
import 'package:p_tits_pas/services/auth_service.dart';
import 'package:p_tits_pas/services/couple_garde_service.dart';
import 'package:p_tits_pas/widgets/quotidien/cartes_feed.dart';
import 'package:p_tits_pas/widgets/quotidien/couple_selector_bandeau.dart';
import 'package:p_tits_pas/widgets/quotidien/quotidien_shell.dart';
import 'package:p_tits_pas/widgets/quotidien/quotidien_theme.dart';
import 'package:p_tits_pas/screens/home/parent_screen/agenda_absences_stub.dart';
/// Tableau de bord parent — coquille 3 colonnes quotidien (#166).
/// Colonne gauche : sélecteur de couple enfant–nounou (#167).
/// Métier cartes / blog / messagerie : tickets C/D/E.
/// Colonne gauche : sélecteur de couple (#167) + feed bulles (#173).
class ParentDashboardScreen extends StatefulWidget {
const ParentDashboardScreen({super.key});
@@ -63,7 +63,6 @@ class _ParentDashboardScreenState extends State<ParentDashboardScreen> {
Future<void> _selectCouple(CoupleGarde couple) async {
if (couple.id == _selectedCoupleId) return;
// Optimiste : on bascule tout de suite, l'API persiste ensuite.
setState(() => _selectedCoupleId = couple.id);
try {
final res = await CoupleGardeService.definirCoupleCourant(couple.id);
@@ -116,6 +115,7 @@ class _ParentDashboardScreenState extends State<ParentDashboardScreen> {
error: _couplesError,
onRetry: _loadCouples,
onCoupleSelected: _selectCouple,
onAjouterBulle: () => _soon('Ajouter une bulle'),
),
centerColumn: const QuotidienColumnPlaceholder(
title: 'Blog',
@@ -138,7 +138,7 @@ class _ParentDashboardScreenState extends State<ParentDashboardScreen> {
}
}
/// Colonne gauche : bandeau couple (#167) puis flux de cartes (#173 à venir).
/// Colonne gauche : bandeau couple (#167) puis flux de cartes (#173).
class _LeftColumn extends StatelessWidget {
final List<CoupleGarde> couples;
final String? selectedCoupleId;
@@ -146,6 +146,7 @@ class _LeftColumn extends StatelessWidget {
final String? error;
final VoidCallback onRetry;
final ValueChanged<CoupleGarde> onCoupleSelected;
final VoidCallback onAjouterBulle;
const _LeftColumn({
required this.couples,
@@ -154,6 +155,7 @@ class _LeftColumn extends StatelessWidget {
required this.error,
required this.onRetry,
required this.onCoupleSelected,
required this.onAjouterBulle,
});
@override
@@ -172,12 +174,10 @@ class _LeftColumn extends StatelessWidget {
onCoupleSelected: onCoupleSelected,
),
const SizedBox(height: 14),
const Expanded(
child: QuotidienColumnPlaceholder(
title: 'Cartes',
subtitle:
'Absences, congés AM, sorties à valider\n(à brancher — ticket #173).',
icon: Icons.style_outlined,
Expanded(
child: CartesFeed(
placementId: selectedCoupleId,
onAjouterBulle: onAjouterBulle,
),
),
],