feat(ui): RefreshIndicator + AlwaysScrollable + dark mode sur 14 pages

RefreshIndicator ajouté (dispatche les events BLoC appropriés) :
- adhesion_detail, adhesions_page, demande_aide_detail, demandes_aide_page
- event_detail, organization_detail, org_selector, org_types
- user_management_detail, reports (TabBarView), logs (Dashboard tab)
- profile (onglet Perso), backup (3 onglets), notifications

Fixes associés :
- AlwaysScrollableScrollPhysics sur tous les scroll widgets
  (permet pull-to-refresh même si contenu < écran)
- Empty states des listes : wrappés dans SingleChildScrollView pour refresh
- Dark mode adaptatif sur textes/surfaces/borders hardcodés
- backup_page : bouton retour ajouté dans le header gradient
- org_types : chevron/star/border adaptatifs
- reports : couleurs placeholders graphique + chevrons
This commit is contained in:
dahoud
2026-04-15 20:13:50 +00:00
parent f78892e5f6
commit 55f84da49a
14 changed files with 1565 additions and 1538 deletions

View File

@@ -28,18 +28,19 @@ class _DemandeAideDetailPageState extends State<DemandeAideDetailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.background,
appBar: const UFAppBar(
title: 'DÉTAIL DEMANDE',
backgroundColor: AppColors.surface,
foregroundColor: AppColors.textPrimaryLight,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: UFAppBar(
title: 'Détail Demande',
moduleGradient: ModuleColors.solidariteGradient,
),
body: BlocConsumer<SolidarityBloc, SolidarityState>(
body: SafeArea(
top: false,
child: BlocConsumer<SolidarityBloc, SolidarityState>(
listenWhen: (prev, curr) => prev.status != curr.status,
listener: (context, state) {
if (state.status == SolidarityStatus.error && state.message != null) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(state.message!), backgroundColor: Colors.red),
SnackBar(content: Text(state.message!), backgroundColor: AppColors.error),
);
}
},
@@ -55,7 +56,7 @@ class _DemandeAideDetailPageState extends State<DemandeAideDetailPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.error_outline, size: 64, color: Colors.grey),
const Icon(Icons.error_outline, size: 64, color: AppColors.textTertiary),
const SizedBox(height: 16),
Text(
'Demande introuvable',
@@ -65,7 +66,12 @@ class _DemandeAideDetailPageState extends State<DemandeAideDetailPage> {
),
);
}
return SingleChildScrollView(
return RefreshIndicator(
color: ModuleColors.solidarite,
onRefresh: () async =>
context.read<SolidarityBloc>().add(LoadDemandeAideById(widget.demandeId)),
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -97,10 +103,12 @@ class _DemandeAideDetailPageState extends State<DemandeAideDetailPage> {
_ActionsSection(demande: d, isGestionnaire: _isGestionnaire()),
],
),
);
), // SingleChildScrollView
); // RefreshIndicator
},
),
);
), // BlocConsumer
), // SafeArea
); // Scaffold
}
bool _isGestionnaire() {
@@ -136,7 +144,7 @@ class _InfoCard extends StatelessWidget {
style: AppTypography.subtitleSmall.copyWith(
fontWeight: FontWeight.bold,
fontSize: 9,
color: AppColors.textSecondaryLight,
color: AppColors.textSecondary,
),
),
const SizedBox(height: 2),

View File

@@ -76,17 +76,16 @@ class _DemandesAidePageState extends State<DemandesAidePage>
}
},
child: Scaffold(
backgroundColor: AppColors.background,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: UFAppBar(
title: 'SOLIDARITÉ',
backgroundColor: AppColors.surface,
foregroundColor: AppColors.textPrimaryLight,
title: 'Solidarité',
moduleGradient: ModuleColors.solidariteGradient,
bottom: TabBar(
controller: _tabController,
onTap: _loadTab,
labelColor: AppColors.primaryGreen,
unselectedLabelColor: AppColors.textSecondaryLight,
indicatorColor: AppColors.primaryGreen,
labelColor: Colors.white,
unselectedLabelColor: Colors.white70,
indicatorColor: Colors.white,
indicatorSize: TabBarIndicatorSize.label,
labelStyle: AppTypography.actionText.copyWith(fontSize: 10, fontWeight: FontWeight.bold),
tabs: const [
@@ -125,7 +124,13 @@ class _DemandesAidePageState extends State<DemandesAidePage>
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.volunteer_activism_outlined, size: 32, color: AppColors.lightBorder),
Icon(
Icons.volunteer_activism_outlined,
size: 32,
color: Theme.of(context).brightness == Brightness.dark
? AppColors.borderDark
: AppColors.border,
),
const SizedBox(height: 12),
Text('Aucune demande', style: AppTypography.subtitleSmall),
],
@@ -204,7 +209,7 @@ class _DemandeCard extends StatelessWidget {
],
),
),
_buildStatutBadge(demande.statut),
_buildStatutBadge(context, demande.statut),
],
),
const SizedBox(height: 12),
@@ -217,7 +222,7 @@ class _DemandeCard extends StatelessWidget {
Text('MONTANT DEMANDÉ', style: AppTypography.subtitleSmall.copyWith(fontSize: 8, fontWeight: FontWeight.bold)),
Text(
currencyFormat.format(demande.montantDemande ?? 0),
style: AppTypography.headerSmall.copyWith(fontSize: 13, color: AppColors.primaryGreen),
style: AppTypography.headerSmall.copyWith(fontSize: 13, color: AppColors.primary),
),
],
),
@@ -235,7 +240,7 @@ class _DemandeCard extends StatelessWidget {
);
}
Widget _buildStatutBadge(String? statut) {
Widget _buildStatutBadge(BuildContext context, String? statut) {
Color color;
switch (statut) {
case 'APPROUVEE':
@@ -246,10 +251,12 @@ class _DemandeCard extends StatelessWidget {
break;
case 'EN_ATTENTE':
case 'SOUMISE':
color = AppColors.brandGreenLight;
color = AppColors.primaryLight;
break;
default:
color = AppColors.textSecondaryLight;
color = Theme.of(context).brightness == Brightness.dark
? AppColors.textSecondaryDark
: AppColors.textSecondary;
}
return InfoBadge(text: statut ?? 'INCONNU', backgroundColor: color);
}