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

@@ -31,13 +31,14 @@ class _AdhesionDetailPageState extends State<AdhesionDetailPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.background,
appBar: const UFAppBar(
title: 'DÉTAIL ADHÉSION',
backgroundColor: AppColors.surface,
foregroundColor: AppColors.textPrimaryLight,
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
appBar: UFAppBar(
title: 'Détail Adhésion',
moduleGradient: ModuleColors.adhesionsGradient,
),
body: BlocConsumer<AdhesionsBloc, AdhesionsState>(
body: SafeArea(
top: false,
child: BlocConsumer<AdhesionsBloc, AdhesionsState>(
listenWhen: (prev, curr) => prev.status != curr.status,
listener: (context, state) {
if (state.status == AdhesionsStatus.error && state.message != null) {
@@ -58,7 +59,7 @@ class _AdhesionDetailPageState extends State<AdhesionDetailPage> {
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Icon(Icons.error_outline, size: 64, color: AppColors.textSecondaryLight),
Icon(Icons.error_outline, size: 64, color: Theme.of(context).colorScheme.onSurfaceVariant),
const SizedBox(height: 16),
Text(
'Adhésion introuvable',
@@ -68,7 +69,12 @@ class _AdhesionDetailPageState extends State<AdhesionDetailPage> {
),
);
}
return SingleChildScrollView(
return RefreshIndicator(
color: ModuleColors.adhesions,
onRefresh: () async =>
context.read<AdhesionsBloc>().add(LoadAdhesionById(widget.adhesionId)),
child: SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -118,10 +124,12 @@ class _AdhesionDetailPageState extends State<AdhesionDetailPage> {
_ActionsSection(adhesion: a, currencyFormat: _currencyFormat, isGestionnaire: _isGestionnaire()),
],
),
);
), // SingleChildScrollView
); // RefreshIndicator
},
),
);
), // BlocConsumer
), // SafeArea
); // Scaffold
}
bool _isGestionnaire() {
@@ -157,7 +165,7 @@ class _InfoCard extends StatelessWidget {
style: AppTypography.subtitleSmall.copyWith(
fontWeight: FontWeight.bold,
fontSize: 9,
color: AppColors.textSecondaryLight,
color: AppColors.textSecondary,
),
),
const SizedBox(height: 2),
@@ -187,13 +195,13 @@ Widget _buildStatutBadge(String? statut) {
color = AppColors.error;
break;
case 'EN_ATTENTE':
color = AppColors.brandGreenLight;
color = AppColors.primaryLight;
break;
case 'EN_PAIEMENT':
color = AppColors.warning;
break;
default:
color = AppColors.textSecondaryLight;
color = AppColors.textSecondary;
}
return InfoBadge(text: statut ?? 'INCONNU', backgroundColor: color);
}
@@ -307,7 +315,7 @@ class _ActionsSection extends StatelessWidget {
);
},
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.primaryGreen,
backgroundColor: AppColors.primary,
foregroundColor: Colors.white,
elevation: 0,
padding: const EdgeInsets.symmetric(vertical: 12),