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:
@@ -56,7 +56,7 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
_getChartIcon(),
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
size: 18,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -100,12 +100,12 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
PieChartSectionData(
|
||||
color: AppColors.lightBorder,
|
||||
color: AppColors.border,
|
||||
value: (stats.totalMembers - stats.activeMembers).toDouble(),
|
||||
title: '${stats.totalMembers - stats.activeMembers}',
|
||||
radius: 45,
|
||||
titleStyle: AppTypography.badgeText.copyWith(
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
@@ -123,7 +123,7 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
horizontalInterval: stats.totalContributionAmount / 4,
|
||||
getDrawingHorizontalLine: (value) {
|
||||
return const FlLine(
|
||||
color: AppColors.lightBorder,
|
||||
color: AppColors.border,
|
||||
strokeWidth: 1,
|
||||
);
|
||||
},
|
||||
@@ -174,8 +174,8 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
isCurved: true,
|
||||
gradient: const LinearGradient(
|
||||
colors: [
|
||||
AppColors.brandGreen,
|
||||
AppColors.primaryGreen,
|
||||
AppColors.primaryDark,
|
||||
AppColors.primary,
|
||||
],
|
||||
),
|
||||
barWidth: 3,
|
||||
@@ -185,8 +185,8 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
show: true,
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.brandGreen.withOpacity(0.3),
|
||||
AppColors.primaryGreen.withOpacity(0.1),
|
||||
AppColors.primaryDark.withOpacity(0.3),
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
@@ -314,13 +314,13 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
Widget _buildLoadingChart() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.lightBorder.withOpacity(0.5),
|
||||
color: AppColors.border.withOpacity(0.5),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: const Center(
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(AppColors.primaryGreen),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(AppColors.primary),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -359,7 +359,7 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
Widget _buildEmptyChart() {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.lightBorder.withOpacity(0.2),
|
||||
color: AppColors.border.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Center(
|
||||
@@ -368,7 +368,7 @@ class DashboardChartWidget extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.bar_chart_outlined,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
size: 24,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
@@ -10,28 +10,28 @@ import '../../../../../shared/design_system/unionflow_design_system.dart';
|
||||
class ActivityItem extends StatelessWidget {
|
||||
/// Titre principal de l'activité
|
||||
final String title;
|
||||
|
||||
|
||||
/// Description ou détails de l'activité
|
||||
final String? description;
|
||||
|
||||
|
||||
/// Horodatage de l'activité
|
||||
final String timestamp;
|
||||
|
||||
|
||||
/// Icône représentative de l'activité
|
||||
final IconData? icon;
|
||||
|
||||
|
||||
/// Couleur thématique de l'activité
|
||||
final Color? color;
|
||||
|
||||
|
||||
/// Type d'activité pour le style automatique
|
||||
final ActivityType? type;
|
||||
|
||||
|
||||
/// Callback lors du tap sur l'élément
|
||||
final VoidCallback? onTap;
|
||||
|
||||
|
||||
/// Style de l'élément d'activité
|
||||
final ActivityItemStyle style;
|
||||
|
||||
|
||||
/// Afficher ou non l'indicateur de statut
|
||||
final bool showStatusIndicator;
|
||||
|
||||
@@ -95,7 +95,7 @@ class ActivityItem extends StatelessWidget {
|
||||
required this.timestamp,
|
||||
this.onTap,
|
||||
}) : icon = Icons.error,
|
||||
color = Colors.red,
|
||||
color = ColorTokens.error,
|
||||
type = ActivityType.error,
|
||||
style = ActivityItemStyle.alert,
|
||||
showStatusIndicator = true;
|
||||
@@ -108,7 +108,7 @@ class ActivityItem extends StatelessWidget {
|
||||
required this.timestamp,
|
||||
this.onTap,
|
||||
}) : icon = Icons.check_circle,
|
||||
color = const Color(0xFF00B894),
|
||||
color = ColorTokens.successLight,
|
||||
type = ActivityType.success,
|
||||
style = ActivityItemStyle.normal,
|
||||
showStatusIndicator = true;
|
||||
@@ -123,28 +123,29 @@ class ActivityItem extends StatelessWidget {
|
||||
child: Container(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
padding: _getPadding(),
|
||||
decoration: _getDecoration(effectiveColor),
|
||||
child: _buildContent(effectiveColor, effectiveIcon),
|
||||
decoration: _getDecoration(context, effectiveColor),
|
||||
child: _buildContent(context, effectiveColor, effectiveIcon),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Contenu principal de l'élément
|
||||
Widget _buildContent(Color effectiveColor, IconData effectiveIcon) {
|
||||
Widget _buildContent(BuildContext context, Color effectiveColor, IconData effectiveIcon) {
|
||||
switch (style) {
|
||||
case ActivityItemStyle.minimal:
|
||||
return _buildMinimalContent(effectiveColor, effectiveIcon);
|
||||
return _buildMinimalContent(context, effectiveColor, effectiveIcon);
|
||||
case ActivityItemStyle.normal:
|
||||
return _buildNormalContent(effectiveColor, effectiveIcon);
|
||||
return _buildNormalContent(context, effectiveColor, effectiveIcon);
|
||||
case ActivityItemStyle.detailed:
|
||||
return _buildDetailedContent(effectiveColor, effectiveIcon);
|
||||
return _buildDetailedContent(context, effectiveColor, effectiveIcon);
|
||||
case ActivityItemStyle.alert:
|
||||
return _buildAlertContent(effectiveColor, effectiveIcon);
|
||||
return _buildAlertContent(context, effectiveColor, effectiveIcon);
|
||||
}
|
||||
}
|
||||
|
||||
/// Contenu minimal (ligne simple)
|
||||
Widget _buildMinimalContent(Color effectiveColor, IconData effectiveIcon) {
|
||||
Widget _buildMinimalContent(BuildContext context, Color effectiveColor, IconData effectiveIcon) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
children: [
|
||||
if (showStatusIndicator)
|
||||
@@ -160,16 +161,17 @@ class ActivityItem extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
timestamp,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
style: TextStyle(
|
||||
color: scheme.onSurfaceVariant,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
@@ -178,7 +180,8 @@ class ActivityItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// Contenu normal avec icône
|
||||
Widget _buildNormalContent(Color effectiveColor, IconData effectiveIcon) {
|
||||
Widget _buildNormalContent(BuildContext context, Color effectiveColor, IconData effectiveIcon) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
children: [
|
||||
if (showStatusIndicator) ...[
|
||||
@@ -202,10 +205,10 @@ class ActivityItem extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
if (description != null) ...[
|
||||
@@ -214,7 +217,7 @@ class ActivityItem extends StatelessWidget {
|
||||
description!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -225,7 +228,7 @@ class ActivityItem extends StatelessWidget {
|
||||
Text(
|
||||
timestamp,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
color: scheme.onSurfaceVariant,
|
||||
fontSize: 11,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -235,7 +238,8 @@ class ActivityItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// Contenu détaillé avec plus d'informations
|
||||
Widget _buildDetailedContent(Color effectiveColor, IconData effectiveIcon) {
|
||||
Widget _buildDetailedContent(BuildContext context, Color effectiveColor, IconData effectiveIcon) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -257,17 +261,17 @@ class ActivityItem extends StatelessWidget {
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Color(0xFF1F2937),
|
||||
color: scheme.onSurface,
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
timestamp,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
color: scheme.onSurfaceVariant,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -282,7 +286,7 @@ class ActivityItem extends StatelessWidget {
|
||||
description!,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey[700],
|
||||
color: scheme.onSurfaceVariant,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
@@ -293,7 +297,8 @@ class ActivityItem extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// Contenu pour les alertes avec style spécial
|
||||
Widget _buildAlertContent(Color effectiveColor, IconData effectiveIcon) {
|
||||
Widget _buildAlertContent(BuildContext context, Color effectiveColor, IconData effectiveIcon) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
return Row(
|
||||
children: [
|
||||
Icon(
|
||||
@@ -320,7 +325,7 @@ class ActivityItem extends StatelessWidget {
|
||||
description!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -331,7 +336,7 @@ class ActivityItem extends StatelessWidget {
|
||||
Text(
|
||||
timestamp,
|
||||
style: TextStyle(
|
||||
color: Colors.grey[500],
|
||||
color: scheme.onSurfaceVariant,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
@@ -366,7 +371,7 @@ class ActivityItem extends StatelessWidget {
|
||||
/// Icône effective selon le type
|
||||
IconData _getEffectiveIcon() {
|
||||
if (icon != null) return icon!;
|
||||
|
||||
|
||||
switch (type) {
|
||||
case ActivityType.system:
|
||||
return Icons.settings;
|
||||
@@ -401,19 +406,20 @@ class ActivityItem extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Décoration selon le style
|
||||
BoxDecoration _getDecoration(Color effectiveColor) {
|
||||
/// Décoration selon le style — toujours theme-aware
|
||||
BoxDecoration _getDecoration(BuildContext context, Color effectiveColor) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
switch (style) {
|
||||
case ActivityItemStyle.minimal:
|
||||
return const BoxDecoration();
|
||||
case ActivityItemStyle.normal:
|
||||
return BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: scheme.surface,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
);
|
||||
case ActivityItemStyle.detailed:
|
||||
return BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: scheme.surface,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
);
|
||||
case ActivityItemStyle.alert:
|
||||
|
||||
@@ -10,25 +10,25 @@ import '../../../../../shared/design_system/unionflow_design_system.dart';
|
||||
class SectionHeader extends StatelessWidget {
|
||||
/// Titre principal de la section
|
||||
final String title;
|
||||
|
||||
|
||||
/// Sous-titre optionnel
|
||||
final String? subtitle;
|
||||
|
||||
|
||||
/// Widget d'action à droite (bouton, icône, etc.)
|
||||
final Widget? action;
|
||||
|
||||
|
||||
/// Icône optionnelle à gauche du titre
|
||||
final IconData? icon;
|
||||
|
||||
/// Couleur du titre et de l'icône
|
||||
|
||||
/// Couleur du titre et de l'icône (null = adaptatif selon le thème)
|
||||
final Color? color;
|
||||
|
||||
|
||||
/// Taille du titre
|
||||
final double? fontSize;
|
||||
|
||||
|
||||
/// Style de l'en-tête
|
||||
final SectionHeaderStyle style;
|
||||
|
||||
|
||||
/// Espacement en bas de l'en-tête
|
||||
final double bottomSpacing;
|
||||
|
||||
@@ -68,14 +68,14 @@ class SectionHeader extends StatelessWidget {
|
||||
style = SectionHeaderStyle.normal,
|
||||
bottomSpacing = 8;
|
||||
|
||||
/// Constructeur pour un en-tête de sous-section
|
||||
/// Constructeur pour un en-tête de sous-section (couleur adaptative)
|
||||
const SectionHeader.subsection({
|
||||
super.key,
|
||||
required this.title,
|
||||
this.subtitle,
|
||||
this.action,
|
||||
this.icon,
|
||||
}) : color = const Color(0xFF374151),
|
||||
}) : color = null, // null → adaptatif via Theme.of(context).colorScheme.onSurface
|
||||
fontSize = 14,
|
||||
style = SectionHeaderStyle.minimal,
|
||||
bottomSpacing = 8;
|
||||
@@ -84,25 +84,26 @@ class SectionHeader extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.only(bottom: bottomSpacing),
|
||||
child: _buildContent(),
|
||||
child: _buildContent(context),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildContent() {
|
||||
Widget _buildContent(BuildContext context) {
|
||||
switch (style) {
|
||||
case SectionHeaderStyle.primary:
|
||||
return _buildPrimaryHeader();
|
||||
return _buildPrimaryHeader(context);
|
||||
case SectionHeaderStyle.normal:
|
||||
return _buildNormalHeader();
|
||||
return _buildNormalHeader(context);
|
||||
case SectionHeaderStyle.minimal:
|
||||
return _buildMinimalHeader();
|
||||
return _buildMinimalHeader(context);
|
||||
case SectionHeaderStyle.card:
|
||||
return _buildCardHeader();
|
||||
return _buildCardHeader(context);
|
||||
}
|
||||
}
|
||||
|
||||
/// En-tête principal avec fond coloré
|
||||
Widget _buildPrimaryHeader() {
|
||||
/// En-tête principal avec fond coloré (gradient sur couleur thématique)
|
||||
/// Colors.white est correct ici : texte sur fond coloré opaque
|
||||
Widget _buildPrimaryHeader(BuildContext context) {
|
||||
final effectiveColor = color ?? ColorTokens.primary;
|
||||
|
||||
return Container(
|
||||
@@ -167,13 +168,15 @@ class SectionHeader extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// En-tête normal avec icône et action
|
||||
Widget _buildNormalHeader() {
|
||||
Widget _buildNormalHeader(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final effectiveColor = color ?? scheme.primary;
|
||||
return Row(
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(
|
||||
icon,
|
||||
color: color ?? ColorTokens.primary,
|
||||
color: effectiveColor,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: SpacingTokens.md),
|
||||
@@ -187,7 +190,7 @@ class SectionHeader extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: fontSize ?? 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color ?? ColorTokens.primary,
|
||||
color: effectiveColor,
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ...[
|
||||
@@ -196,7 +199,7 @@ class SectionHeader extends StatelessWidget {
|
||||
subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -208,14 +211,16 @@ class SectionHeader extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// En-tête minimal simple
|
||||
Widget _buildMinimalHeader() {
|
||||
/// En-tête minimal simple — couleur totalement adaptative
|
||||
Widget _buildMinimalHeader(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final effectiveColor = color ?? scheme.onSurface;
|
||||
return Row(
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(
|
||||
icon,
|
||||
color: color ?? const Color(0xFF374151),
|
||||
color: effectiveColor,
|
||||
size: 16,
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
@@ -226,7 +231,7 @@ class SectionHeader extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: fontSize ?? 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: color ?? const Color(0xFF374151),
|
||||
color: effectiveColor,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -235,20 +240,23 @@ class SectionHeader extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
/// En-tête avec fond de carte
|
||||
Widget _buildCardHeader() {
|
||||
/// En-tête avec fond de carte — surface theme-aware
|
||||
Widget _buildCardHeader(BuildContext context) {
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final effectiveColor = color ?? scheme.primary;
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
color: scheme.surface,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: scheme.outline, width: 0.5),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
if (icon != null) ...[
|
||||
Icon(
|
||||
icon,
|
||||
color: color ?? ColorTokens.primary,
|
||||
color: effectiveColor,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: SpacingTokens.md),
|
||||
@@ -262,7 +270,7 @@ class SectionHeader extends StatelessWidget {
|
||||
style: TextStyle(
|
||||
fontSize: fontSize ?? 13,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color ?? ColorTokens.primary,
|
||||
color: effectiveColor,
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ...[
|
||||
@@ -271,7 +279,7 @@ class SectionHeader extends StatelessWidget {
|
||||
subtitle!,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey[600],
|
||||
color: scheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -46,36 +46,37 @@ class ConnectedStatsCard extends StatelessWidget {
|
||||
Widget _buildDataCard(DashboardStatsEntity stats) {
|
||||
final value = valueExtractor(stats);
|
||||
final subtitle = subtitleExtractor?.call(stats);
|
||||
final color = customColor ?? AppColors.primaryGreen;
|
||||
final color = customColor ?? AppColors.primary;
|
||||
|
||||
return CoreCard(
|
||||
onTap: onTap,
|
||||
padding: const EdgeInsets.all(10),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(7),
|
||||
padding: const EdgeInsets.all(5),
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: color,
|
||||
size: 16,
|
||||
size: 14,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
const SizedBox(width: 6),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title.toUpperCase(),
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
letterSpacing: 1.1,
|
||||
fontSize: 9,
|
||||
letterSpacing: 1.0,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
@@ -83,22 +84,28 @@ class ConnectedStatsCard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
value,
|
||||
style: AppTypography.headerSmall.copyWith(
|
||||
color: color,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 18,
|
||||
const SizedBox(height: 4),
|
||||
Flexible(
|
||||
child: Text(
|
||||
value,
|
||||
style: AppTypography.headerSmall.copyWith(
|
||||
color: color,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
if (subtitle != null) ...[
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
subtitle,
|
||||
style: AppTypography.subtitleSmall.copyWith(fontSize: 10),
|
||||
if (subtitle != null)
|
||||
Flexible(
|
||||
child: Text(
|
||||
subtitle,
|
||||
style: AppTypography.subtitleSmall.copyWith(fontSize: 9),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
/// Widget de menu latéral (drawer) du dashboard
|
||||
library dashboard_drawer;
|
||||
|
||||
import 'dart:math' as math;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import '../../../../core/theme/theme_provider.dart';
|
||||
import '../../../../shared/design_system/unionflow_design_system.dart';
|
||||
import '../../../../shared/widgets/core_card.dart';
|
||||
import '../../../../shared/widgets/mini_avatar.dart';
|
||||
|
||||
import '../../../authentication/presentation/bloc/auth_bloc.dart';
|
||||
import '../../../authentication/data/models/user_role.dart';
|
||||
import '../../../profile/presentation/pages/profile_page_wrapper.dart';
|
||||
import '../../../notifications/presentation/pages/notifications_page_wrapper.dart';
|
||||
import '../../../help/presentation/pages/help_support_page.dart';
|
||||
import '../../../about/presentation/pages/about_page.dart';
|
||||
import '../../../admin/presentation/pages/user_management_page.dart';
|
||||
import '../../../settings/presentation/pages/system_settings_page.dart';
|
||||
import '../../../backup/presentation/pages/backup_page.dart';
|
||||
import '../../../logs/presentation/pages/logs_page.dart';
|
||||
|
||||
/// Drawer principal — Mon Espace
|
||||
/// Profil · Notifications · Aide · À propos · Déconnexion
|
||||
class DashboardDrawer extends StatelessWidget {
|
||||
@@ -30,7 +40,7 @@ class DashboardDrawer extends StatelessWidget {
|
||||
|
||||
return Drawer(
|
||||
backgroundColor:
|
||||
isDark ? AppColors.darkSurface : AppColors.lightBackground,
|
||||
isDark ? AppColors.surfaceDark : AppColors.background,
|
||||
child: SafeArea(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(10),
|
||||
@@ -39,6 +49,9 @@ class DashboardDrawer extends StatelessWidget {
|
||||
children: [
|
||||
_buildUserProfile(context, authState),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
_buildSectionTitle(context, 'Apparence'),
|
||||
const _ThemeToggleTile(),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
_buildSectionTitle(context, 'Mon Espace'),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
@@ -77,6 +90,53 @@ class DashboardDrawer extends StatelessWidget {
|
||||
MaterialPageRoute(builder: (_) => const AboutPage()),
|
||||
),
|
||||
),
|
||||
|
||||
// ── Section SYSTÈME (super admin uniquement) ──
|
||||
if (authState.effectiveRole == UserRole.superAdmin) ...[
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
_buildSectionTitle(context, 'Système'),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
icon: Icons.people,
|
||||
title: 'Gestion des utilisateurs',
|
||||
subtitle: 'Utilisateurs Keycloak et rôles',
|
||||
accentColor: ModuleColors.membres,
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const UserManagementPage()),
|
||||
),
|
||||
),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
icon: Icons.settings,
|
||||
title: 'Paramètres Système',
|
||||
subtitle: 'Configuration globale',
|
||||
accentColor: ModuleColors.parametres,
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const SystemSettingsPage()),
|
||||
),
|
||||
),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
icon: Icons.backup,
|
||||
title: 'Sauvegarde & Restauration',
|
||||
subtitle: 'Gestion des sauvegardes',
|
||||
accentColor: ModuleColors.backup,
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const BackupPage()),
|
||||
),
|
||||
),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
icon: Icons.article,
|
||||
title: 'Logs & Monitoring',
|
||||
subtitle: 'Surveillance et journaux',
|
||||
accentColor: ModuleColors.logs,
|
||||
onTap: () => Navigator.of(context).push(
|
||||
MaterialPageRoute(builder: (_) => const LogsPage()),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
_buildOptionTile(
|
||||
context: context,
|
||||
@@ -101,11 +161,11 @@ class DashboardDrawer extends StatelessWidget {
|
||||
Widget _buildUserProfile(BuildContext context, AuthAuthenticated state) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final nameColor =
|
||||
isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight;
|
||||
isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||
final emailColor =
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||
final roleColor =
|
||||
isDark ? AppColors.brandGreenLight : AppColors.primaryGreen;
|
||||
isDark ? AppColors.primaryLight : AppColors.primary;
|
||||
|
||||
return CoreCard(
|
||||
child: Row(
|
||||
@@ -154,7 +214,7 @@ class DashboardDrawer extends StatelessWidget {
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 1.1,
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -169,14 +229,14 @@ class DashboardDrawer extends StatelessWidget {
|
||||
Color? accentColor,
|
||||
}) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final accent = accentColor ?? AppColors.primaryGreen;
|
||||
final accent = accentColor ?? AppColors.primary;
|
||||
final titleColor = accentColor != null
|
||||
? accentColor
|
||||
: (isDark ? AppColors.textPrimaryDark : AppColors.textPrimaryLight);
|
||||
: (isDark ? AppColors.textPrimaryDark : AppColors.textPrimary);
|
||||
final subtitleColor =
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||
final chevronColor =
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight;
|
||||
isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||
|
||||
return CoreCard(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
@@ -213,3 +273,181 @@ class DashboardDrawer extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
// Toggle thème jour / nuit avec animation soleil ↔ lune
|
||||
// ─────────────────────────────────────────────────────────────────────────────
|
||||
|
||||
class _ThemeToggleTile extends StatefulWidget {
|
||||
const _ThemeToggleTile();
|
||||
|
||||
@override
|
||||
State<_ThemeToggleTile> createState() => _ThemeToggleTileState();
|
||||
}
|
||||
|
||||
class _ThemeToggleTileState extends State<_ThemeToggleTile>
|
||||
with SingleTickerProviderStateMixin {
|
||||
late final AnimationController _ctrl;
|
||||
// Rotation complète sur toute la durée
|
||||
late final Animation<double> _rotation;
|
||||
// Scale : 1→0 sur la première moitié, 0→1 sur la seconde
|
||||
late final Animation<double> _scale;
|
||||
|
||||
bool _isAnimating = false;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_ctrl = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 480),
|
||||
);
|
||||
_rotation = Tween<double>(begin: 0, end: 2 * math.pi).animate(
|
||||
CurvedAnimation(parent: _ctrl, curve: Curves.easeInOut),
|
||||
);
|
||||
_scale = TweenSequence<double>([
|
||||
TweenSequenceItem(
|
||||
tween: Tween(begin: 1.0, end: 0.0)
|
||||
.chain(CurveTween(curve: Curves.easeIn)),
|
||||
weight: 50,
|
||||
),
|
||||
TweenSequenceItem(
|
||||
tween: Tween(begin: 0.0, end: 1.0)
|
||||
.chain(CurveTween(curve: Curves.elasticOut)),
|
||||
weight: 50,
|
||||
),
|
||||
]).animate(_ctrl);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_ctrl.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _toggle() async {
|
||||
if (_isAnimating) return;
|
||||
_isAnimating = true;
|
||||
|
||||
// Première moitié : rotation + disparition de l'icône
|
||||
await _ctrl.animateTo(0.5);
|
||||
|
||||
// Bascule le thème au moment où l'icône est invisible (scale ≈ 0)
|
||||
if (mounted) {
|
||||
final tp = context.read<ThemeProvider>();
|
||||
tp.setMode(tp.mode == ThemeMode.dark ? ThemeMode.light : ThemeMode.dark);
|
||||
}
|
||||
|
||||
// Seconde moitié : réapparition avec la nouvelle icône + fin de rotation
|
||||
if (mounted) await _ctrl.animateTo(1.0);
|
||||
|
||||
_ctrl.reset();
|
||||
_isAnimating = false;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final tp = context.watch<ThemeProvider>();
|
||||
final isDark = tp.mode == ThemeMode.dark;
|
||||
final isDarkBrightness = Theme.of(context).brightness == Brightness.dark;
|
||||
|
||||
// Soleil = jaune ambré / Lune = indigo
|
||||
final accent =
|
||||
isDark ? const Color(0xFFFBBF24) : const Color(0xFF6366F1);
|
||||
final titleColor =
|
||||
isDarkBrightness ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||
final subtitleColor = isDarkBrightness
|
||||
? AppColors.textSecondaryDark
|
||||
: AppColors.textSecondary;
|
||||
|
||||
return CoreCard(
|
||||
margin: const EdgeInsets.only(bottom: 8),
|
||||
onTap: _toggle,
|
||||
child: Row(
|
||||
children: [
|
||||
// Icône animée
|
||||
AnimatedBuilder(
|
||||
animation: _ctrl,
|
||||
builder: (_, __) => Transform.rotate(
|
||||
angle: _rotation.value,
|
||||
child: Transform.scale(
|
||||
scale: _scale.value.clamp(0.01, 1.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: accent.withOpacity(isDarkBrightness ? 0.22 : 0.12),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
isDark ? Icons.light_mode_rounded : Icons.dark_mode_rounded,
|
||||
color: accent,
|
||||
size: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Thème',
|
||||
style: AppTypography.actionText.copyWith(color: titleColor),
|
||||
),
|
||||
AnimatedSwitcher(
|
||||
duration: const Duration(milliseconds: 200),
|
||||
child: Text(
|
||||
isDark ? 'Mode sombre' : 'Mode clair',
|
||||
key: ValueKey(isDark),
|
||||
style: AppTypography.subtitleSmall
|
||||
.copyWith(color: subtitleColor),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Pill toggle animée
|
||||
GestureDetector(
|
||||
onTap: _toggle,
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
width: 40,
|
||||
height: 22,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(11),
|
||||
color: isDark
|
||||
? const Color(0xFF6366F1)
|
||||
: AppColors.borderStrong,
|
||||
),
|
||||
child: AnimatedAlign(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
alignment:
|
||||
isDark ? Alignment.centerRight : Alignment.centerLeft,
|
||||
child: Container(
|
||||
margin: const EdgeInsets.all(2),
|
||||
width: 18,
|
||||
height: 18,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: Colors.white,
|
||||
boxShadow: const [
|
||||
BoxShadow(
|
||||
color: Colors.black26,
|
||||
blurRadius: 4,
|
||||
offset: Offset(0, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,14 +28,14 @@ class DashboardStat extends StatelessWidget {
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
color: color ?? AppColors.primaryGreen,
|
||||
color: color ?? AppColors.primary,
|
||||
size: 20,
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
value,
|
||||
style: AppTypography.headerSmall.copyWith(
|
||||
color: color ?? AppColors.primaryGreen,
|
||||
color: color ?? AppColors.primary,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
@@ -130,12 +130,12 @@ class DashboardQuickAction extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
color: (color ?? AppColors.primaryGreen).withOpacity(0.1),
|
||||
color: (color ?? AppColors.primary).withOpacity(0.1),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: color ?? AppColors.primaryGreen,
|
||||
color: color ?? AppColors.primary,
|
||||
size: 24,
|
||||
),
|
||||
),
|
||||
@@ -211,12 +211,12 @@ class DashboardActivity extends StatelessWidget {
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: (color ?? AppColors.primaryGreen).withOpacity(0.1),
|
||||
color: (color ?? AppColors.primary).withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(
|
||||
icon,
|
||||
color: color ?? AppColors.primaryGreen,
|
||||
color: color ?? AppColors.primary,
|
||||
size: 14,
|
||||
),
|
||||
),
|
||||
@@ -245,7 +245,7 @@ class DashboardActivity extends StatelessWidget {
|
||||
return Text(
|
||||
time,
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondaryLight,
|
||||
color: isDark ? AppColors.textSecondaryDark : AppColors.textSecondary,
|
||||
fontSize: 9,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -86,7 +86,7 @@ class _RealTimeMetricsWidgetState extends State<RealTimeMetricsWidget>
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [AppColors.brandGreen, AppColors.primaryGreen],
|
||||
colors: [AppColors.primaryDark, AppColors.primary],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
),
|
||||
|
||||
@@ -158,7 +158,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
height: 20,
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(AppColors.primaryGreen),
|
||||
valueColor: AlwaysStoppedAnimation<Color>(AppColors.primary),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
@@ -213,7 +213,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
letterSpacing: 1.1,
|
||||
color: AppColors.textPrimaryLight,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -221,7 +221,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
const SizedBox(width: 8),
|
||||
Icon(
|
||||
_isExpanded ? Icons.expand_less : Icons.expand_more,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
size: 20,
|
||||
),
|
||||
],
|
||||
@@ -263,7 +263,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 9,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
@@ -352,7 +352,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
borderRadius: BorderRadius.circular(2),
|
||||
child: LinearProgressIndicator(
|
||||
value: progress.clamp(0.0, 1.0),
|
||||
backgroundColor: AppColors.lightBorder,
|
||||
backgroundColor: AppColors.border,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(color),
|
||||
minHeight: 4,
|
||||
),
|
||||
@@ -410,7 +410,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
alert.message,
|
||||
style: const TextStyle(
|
||||
fontSize: 11,
|
||||
color: AppColors.textPrimaryLight,
|
||||
color: AppColors.textPrimary,
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -418,7 +418,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
_formatTime(alert.timestamp),
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -427,7 +427,7 @@ class _PerformanceMonitorWidgetState extends State<PerformanceMonitorWidget>
|
||||
}
|
||||
|
||||
Color _getOverallHealthColor() {
|
||||
if (_currentMetrics == null) return AppColors.textSecondaryLight;
|
||||
if (_currentMetrics == null) return AppColors.textSecondary;
|
||||
|
||||
final metrics = _currentMetrics!;
|
||||
|
||||
|
||||
@@ -125,9 +125,9 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).cardColor,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: _isExpanded
|
||||
? [BoxShadow(color: Colors.black.withOpacity(0.1), blurRadius: 10, offset: const Offset(0, 4))]
|
||||
: [BoxShadow(color: Colors.black.withOpacity(0.05), blurRadius: 5, offset: const Offset(0, 2))],
|
||||
boxShadow: _isExpanded
|
||||
? [BoxShadow(color: AppColors.shadowMedium, blurRadius: 10, offset: const Offset(0, 4))]
|
||||
: [BoxShadow(color: AppColors.shadow, blurRadius: 5, offset: const Offset(0, 2))],
|
||||
),
|
||||
child: TextField(
|
||||
controller: _searchController,
|
||||
@@ -141,11 +141,11 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
decoration: InputDecoration(
|
||||
hintText: widget.hintText ?? 'Rechercher...',
|
||||
hintStyle: AppTypography.bodyTextSmall.copyWith(
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
),
|
||||
prefixIcon: Icon(
|
||||
Icons.search_outlined,
|
||||
color: _isExpanded ? AppColors.primaryGreen : AppColors.textSecondaryLight,
|
||||
color: _isExpanded ? AppColors.primary : AppColors.textSecondary,
|
||||
size: 20,
|
||||
),
|
||||
suffixIcon: _searchController.text.isNotEmpty
|
||||
@@ -156,7 +156,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
},
|
||||
icon: const Icon(
|
||||
Icons.close_outlined,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
size: 18,
|
||||
),
|
||||
)
|
||||
@@ -168,7 +168,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
borderSide: const BorderSide(
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
@@ -195,7 +195,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.1),
|
||||
color: AppColors.shadowMedium,
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
@@ -227,7 +227,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
? null
|
||||
: const Border(
|
||||
bottom: BorderSide(
|
||||
color: AppColors.lightBorder,
|
||||
color: AppColors.border,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
@@ -263,7 +263,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
Text(
|
||||
suggestion.subtitle,
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
@@ -273,7 +273,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
),
|
||||
const Icon(
|
||||
Icons.chevron_right_outlined,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
@@ -288,14 +288,14 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
title: 'Membres',
|
||||
subtitle: 'Rechercher des membres',
|
||||
icon: Icons.people_outline,
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute<void>(builder: (_) => const MembersPageWrapper())),
|
||||
),
|
||||
SearchSuggestion(
|
||||
title: 'Événements',
|
||||
subtitle: 'Trouver des événements',
|
||||
icon: Icons.event_outlined,
|
||||
color: AppColors.brandGreen,
|
||||
color: AppColors.primaryDark,
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute<void>(builder: (_) => const EventsPageWrapper())),
|
||||
),
|
||||
SearchSuggestion(
|
||||
@@ -316,7 +316,7 @@ class _DashboardSearchWidgetState extends State<DashboardSearchWidget>
|
||||
title: 'Paramètres',
|
||||
subtitle: 'Configuration système',
|
||||
icon: Icons.settings_outlined,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
onTap: () => Navigator.of(context).push(MaterialPageRoute<void>(builder: (_) => const SystemSettingsPage())),
|
||||
),
|
||||
];
|
||||
|
||||
@@ -40,7 +40,7 @@ class _ThemeSelectorWidgetState extends State<ThemeSelectorWidget> {
|
||||
children: [
|
||||
Icon(
|
||||
Icons.palette,
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
size: 24,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
|
||||
@@ -41,7 +41,7 @@ class DashboardShortcutsWidget extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.flash_on_outlined,
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
size: 18,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
@@ -97,7 +97,7 @@ class DashboardShortcutsWidget extends StatelessWidget {
|
||||
Text(
|
||||
shortcut.title,
|
||||
style: AppTypography.subtitleSmall.copyWith(
|
||||
color: AppColors.textPrimaryLight,
|
||||
color: AppColors.textPrimary,
|
||||
fontSize: 9,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
@@ -127,7 +127,7 @@ class DashboardShortcutsWidget extends StatelessWidget {
|
||||
DashboardShortcut(
|
||||
title: 'Créer\nÉvénement',
|
||||
icon: Icons.event_available_outlined,
|
||||
color: AppColors.primaryGreen,
|
||||
color: AppColors.primary,
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
@@ -139,7 +139,7 @@ class DashboardShortcutsWidget extends StatelessWidget {
|
||||
DashboardShortcut(
|
||||
title: 'Ajouter\nContribution',
|
||||
icon: Icons.account_balance_wallet_outlined,
|
||||
color: AppColors.brandGreen,
|
||||
color: AppColors.primaryDark,
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
@@ -163,7 +163,7 @@ class DashboardShortcutsWidget extends StatelessWidget {
|
||||
DashboardShortcut(
|
||||
title: 'Paramètres',
|
||||
icon: Icons.settings_outlined,
|
||||
color: AppColors.textSecondaryLight,
|
||||
color: AppColors.textSecondary,
|
||||
onTap: () {
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
|
||||
Reference in New Issue
Block a user