feat(#211,#212): sélecteur couple bandeau + état vide Cartes
Closes #211 Closes #212 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -10,7 +10,7 @@ import 'package:p_tits_pas/widgets/quotidien/quotidien_theme.dart';
|
||||
import 'package:p_tits_pas/screens/home/parent_screen/agenda_absences_stub.dart';
|
||||
|
||||
/// Dashboard assistante maternelle – coquille 3 colonnes quotidien (#169).
|
||||
/// Colonne gauche : sélecteur couple (#170) + feed bulles (#174).
|
||||
/// Contexte couple dans le bandeau (#211) ; colonne gauche = feed (#174).
|
||||
/// Création « Ajouter une carte » : modale générique (#175, réutilisée #176).
|
||||
class AmDashboardScreen extends StatefulWidget {
|
||||
const AmDashboardScreen({super.key});
|
||||
@@ -108,16 +108,17 @@ class _AmDashboardScreenState extends State<AmDashboardScreen> {
|
||||
userEmail: _user?.email,
|
||||
onProfileTap: () => _soon('Profil'),
|
||||
onSettingsTap: () => _soon('Paramètres'),
|
||||
// L'AM n'a pas de bouton "Recherche AM" dans le bandeau
|
||||
onSearchAmTap: null,
|
||||
leftColumn: _LeftColumn(
|
||||
contextSelector: CoupleSelectorBandeau(
|
||||
mode: CoupleBandeauMode.assistanteMaternelle,
|
||||
couples: _couples,
|
||||
selectedCoupleId: _selectedCoupleId,
|
||||
loading: _couplesLoading,
|
||||
error: _couplesError,
|
||||
errorMessage: _couplesError,
|
||||
onRetry: _loadCouples,
|
||||
onCoupleSelected: _selectCouple,
|
||||
),
|
||||
leftColumn: _LeftColumn(selectedCoupleId: _selectedCoupleId),
|
||||
centerColumn: const QuotidienColumnPlaceholder(
|
||||
title: 'Blog',
|
||||
subtitle:
|
||||
@@ -139,49 +140,17 @@ class _AmDashboardScreenState extends State<AmDashboardScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Colonne gauche : bandeau couple AM (#170) puis flux de cartes (#174 / #175).
|
||||
/// Colonne gauche : flux de cartes (#174 / #175). Couple = bandeau (#211).
|
||||
class _LeftColumn extends StatelessWidget {
|
||||
final List<CoupleGarde> couples;
|
||||
final String? selectedCoupleId;
|
||||
final bool loading;
|
||||
final String? error;
|
||||
final VoidCallback onRetry;
|
||||
final ValueChanged<CoupleGarde> onCoupleSelected;
|
||||
|
||||
const _LeftColumn({
|
||||
required this.couples,
|
||||
required this.selectedCoupleId,
|
||||
required this.loading,
|
||||
required this.error,
|
||||
required this.onRetry,
|
||||
required this.onCoupleSelected,
|
||||
});
|
||||
const _LeftColumn({required this.selectedCoupleId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
CoupleSelectorBandeau(
|
||||
mode: CoupleBandeauMode.assistanteMaternelle,
|
||||
couples: couples,
|
||||
selectedCoupleId: selectedCoupleId,
|
||||
loading: loading,
|
||||
errorMessage: error,
|
||||
onRetry: onRetry,
|
||||
onCoupleSelected: onCoupleSelected,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Expanded(
|
||||
child: CartesFeed(
|
||||
placementId: selectedCoupleId,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: CartesFeed(placementId: selectedCoupleId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ 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 (#167) + feed bulles (#173).
|
||||
/// Contexte couple dans le bandeau (#211) ; colonne gauche = feed (#173).
|
||||
class ParentDashboardScreen extends StatefulWidget {
|
||||
const ParentDashboardScreen({super.key});
|
||||
|
||||
@@ -108,14 +108,15 @@ class _ParentDashboardScreenState extends State<ParentDashboardScreen> {
|
||||
onProfileTap: () => _soon('Profil'),
|
||||
onSearchAmTap: () => _soon('Recherche AM'),
|
||||
onSettingsTap: () => _soon('Paramètres'),
|
||||
leftColumn: _LeftColumn(
|
||||
contextSelector: CoupleSelectorBandeau(
|
||||
couples: _couples,
|
||||
selectedCoupleId: _selectedCoupleId,
|
||||
loading: _couplesLoading,
|
||||
error: _couplesError,
|
||||
errorMessage: _couplesError,
|
||||
onRetry: _loadCouples,
|
||||
onCoupleSelected: _selectCouple,
|
||||
),
|
||||
leftColumn: _LeftColumn(selectedCoupleId: _selectedCoupleId),
|
||||
centerColumn: const QuotidienColumnPlaceholder(
|
||||
title: 'Blog',
|
||||
subtitle:
|
||||
@@ -137,47 +138,17 @@ class _ParentDashboardScreenState extends State<ParentDashboardScreen> {
|
||||
}
|
||||
}
|
||||
|
||||
/// Colonne gauche : bandeau couple (#167) puis flux de cartes (#173 / #175).
|
||||
/// Colonne gauche : flux de cartes (#173 / #175). Couple = bandeau (#211).
|
||||
class _LeftColumn extends StatelessWidget {
|
||||
final List<CoupleGarde> couples;
|
||||
final String? selectedCoupleId;
|
||||
final bool loading;
|
||||
final String? error;
|
||||
final VoidCallback onRetry;
|
||||
final ValueChanged<CoupleGarde> onCoupleSelected;
|
||||
|
||||
const _LeftColumn({
|
||||
required this.couples,
|
||||
required this.selectedCoupleId,
|
||||
required this.loading,
|
||||
required this.error,
|
||||
required this.onRetry,
|
||||
required this.onCoupleSelected,
|
||||
});
|
||||
const _LeftColumn({required this.selectedCoupleId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(14),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
CoupleSelectorBandeau(
|
||||
couples: couples,
|
||||
selectedCoupleId: selectedCoupleId,
|
||||
loading: loading,
|
||||
errorMessage: error,
|
||||
onRetry: onRetry,
|
||||
onCoupleSelected: onCoupleSelected,
|
||||
),
|
||||
const SizedBox(height: 14),
|
||||
Expanded(
|
||||
child: CartesFeed(
|
||||
placementId: selectedCoupleId,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: CartesFeed(placementId: selectedCoupleId),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user