feat(features): refontes adhesions/admin/auth/backup/contributions/dashboard/epargne/events

- adhesions : bloc complet avec events/states/model, dialogs paiement/rejet
- admin : users bloc, user management list/detail pages
- authentication : bloc + keycloak auth service + webview
- backup : bloc complet, repository, models
- contributions : bloc + widgets + export
- dashboard : widgets connectés (activities, events, notifications, search)
  + charts + monitoring + shortcuts
- epargne : repository, transactions, dialogs
- events : bloc complet, pages (detail, connected, wrapper), models
This commit is contained in:
dahoud
2026-04-15 20:26:48 +00:00
parent 45dcd2171e
commit 120434aba0
36 changed files with 903 additions and 1411 deletions

View File

@@ -1,31 +1,31 @@
import 'package:flutter/material.dart';
/// Widget réutilisable pour afficher une carte de statistique
///
///
/// Composant générique utilisé dans tous les dashboards pour afficher
/// des métriques avec icône, valeur, titre et sous-titre.
class StatCard extends StatelessWidget {
/// Titre principal de la statistique
final String title;
/// Valeur numérique ou textuelle à afficher
final String value;
/// Sous-titre ou description complémentaire
final String subtitle;
/// Icône représentative de la métrique
final IconData icon;
/// Couleur thématique de la carte
final Color color;
/// Callback optionnel lors du tap sur la carte
final VoidCallback? onTap;
/// Taille de la carte (compact, normal, large)
final StatCardSize size;
/// Style de la carte (minimal, elevated, outlined)
final StatCardStyle style;
@@ -71,26 +71,27 @@ class StatCard extends StatelessWidget {
onTap: onTap,
child: Container(
padding: _getPadding(),
decoration: _getDecoration(),
child: _buildContent(),
decoration: _getDecoration(context),
child: _buildContent(context),
),
);
}
/// Contenu principal de la carte
Widget _buildContent() {
Widget _buildContent(BuildContext context) {
switch (size) {
case StatCardSize.compact:
return _buildCompactContent();
return _buildCompactContent(context);
case StatCardSize.normal:
return _buildNormalContent();
return _buildNormalContent(context);
case StatCardSize.large:
return _buildLargeContent();
return _buildLargeContent(context);
}
}
/// Contenu compact pour les KPIs
Widget _buildCompactContent() {
Widget _buildCompactContent(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -111,16 +112,16 @@ class StatCard extends StatelessWidget {
const SizedBox(height: 4),
Text(
title,
style: const TextStyle(
style: TextStyle(
fontWeight: FontWeight.w600,
color: Colors.black87,
color: scheme.onSurface,
fontSize: 12,
),
),
Text(
subtitle,
style: const TextStyle(
color: Colors.grey,
style: TextStyle(
color: scheme.onSurfaceVariant,
fontSize: 10,
),
),
@@ -129,7 +130,8 @@ class StatCard extends StatelessWidget {
}
/// Contenu normal pour les métriques
Widget _buildNormalContent() {
Widget _buildNormalContent(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -159,7 +161,7 @@ class StatCard extends StatelessWidget {
Text(
subtitle,
style: TextStyle(
color: Colors.grey[600],
color: scheme.onSurfaceVariant,
fontSize: 10,
),
),
@@ -170,9 +172,9 @@ class StatCard extends StatelessWidget {
const SizedBox(height: 8),
Text(
title,
style: const TextStyle(
style: TextStyle(
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
color: scheme.onSurface,
fontSize: 13,
),
),
@@ -181,7 +183,8 @@ class StatCard extends StatelessWidget {
}
/// Contenu large pour les dashboards principaux
Widget _buildLargeContent() {
Widget _buildLargeContent(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -211,7 +214,7 @@ class StatCard extends StatelessWidget {
Text(
subtitle,
style: TextStyle(
color: Colors.grey[600],
color: scheme.onSurfaceVariant,
fontSize: 12,
),
),
@@ -222,9 +225,9 @@ class StatCard extends StatelessWidget {
const SizedBox(height: 8),
Text(
title,
style: const TextStyle(
style: TextStyle(
fontWeight: FontWeight.w600,
color: Color(0xFF1F2937),
color: scheme.onSurface,
fontSize: 13,
),
),
@@ -244,22 +247,19 @@ class StatCard extends StatelessWidget {
}
}
/// Décoration selon le style
BoxDecoration _getDecoration() {
/// Décoration selon le style — toujours theme-aware
BoxDecoration _getDecoration(BuildContext context) {
final scheme = Theme.of(context).colorScheme;
switch (style) {
case StatCardStyle.minimal:
return BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8),
);
case StatCardStyle.elevated:
return BoxDecoration(
color: Colors.white,
color: scheme.surface,
borderRadius: BorderRadius.circular(8),
);
case StatCardStyle.outlined:
return BoxDecoration(
color: Colors.white,
color: scheme.surface,
borderRadius: BorderRadius.circular(8),
border: Border.all(
color: color.withOpacity(0.2),