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:
@@ -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,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user