feat(design-system): dark mode adaptatif sur widgets partagés
Pattern AppColors pair (isDark ? AppColors.surfaceDark : AppColors.surface) appliqué sur : - UnionStatWidget, UnionBalanceCard, UnionActionButton, UFSectionHeader - DashboardEventRow, DashboardActivityRow, UnionExportButton - MiniAvatar (border adaptatif) - ConfirmationDialog (cancel colors adaptés) - FileUploadWidget (textSecondary adaptatif) Les couleurs surface/border/textPrimary/textSecondary hardcodées (light-only) sont remplacées par les paires *Dark conditionnelles. Les couleurs sémantiques (error, success, warning, primary) restent inchangées.
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../tokens/unionflow_colors.dart';
|
||||
import '../tokens/app_colors.dart';
|
||||
|
||||
/// Widget de statistique compacte — style identique à _buildKpiCell du super admin
|
||||
/// fond blanc, bordure gauche colorée, icône + valeur + label
|
||||
/// Fond adaptatif dark/light via AppColors, bordure gauche colorée, icône + valeur + label
|
||||
/// [compact] réduit le padding vertical pour les grilles très plates
|
||||
class UnionStatWidget extends StatelessWidget {
|
||||
final String label;
|
||||
@@ -28,6 +28,10 @@ class UnionStatWidget extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final bgColor = isDark ? AppColors.surfaceDark : AppColors.surface;
|
||||
final labelColor = isDark ? AppColors.textSecondaryDark : AppColors.textSecondary;
|
||||
|
||||
final EdgeInsets pad = compact
|
||||
? const EdgeInsets.symmetric(horizontal: 8, vertical: 5)
|
||||
: const EdgeInsets.all(6);
|
||||
@@ -35,7 +39,7 @@ class UnionStatWidget extends StatelessWidget {
|
||||
return Container(
|
||||
padding: pad,
|
||||
decoration: BoxDecoration(
|
||||
color: UnionFlowColors.surface,
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
border: Border(left: BorderSide(color: color, width: 3)),
|
||||
),
|
||||
@@ -51,11 +55,7 @@ class UnionStatWidget extends StatelessWidget {
|
||||
const Spacer(),
|
||||
Text(
|
||||
trend!,
|
||||
style: TextStyle(
|
||||
fontSize: 8,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: color,
|
||||
),
|
||||
style: TextStyle(fontSize: 8, fontWeight: FontWeight.w700, color: color),
|
||||
),
|
||||
],
|
||||
],
|
||||
@@ -74,11 +74,7 @@ class UnionStatWidget extends StatelessWidget {
|
||||
SizedBox(height: compact ? 1 : 2),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(
|
||||
fontSize: 9,
|
||||
fontWeight: FontWeight.w500,
|
||||
color: UnionFlowColors.textSecondary,
|
||||
),
|
||||
style: TextStyle(fontSize: 9, fontWeight: FontWeight.w500, color: labelColor),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user