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,7 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../tokens/app_colors.dart';
|
||||
import '../tokens/unionflow_colors.dart';
|
||||
|
||||
/// Card de balance UnionFlow - Affichage élégant du solde principal
|
||||
/// Card de balance UnionFlow — Affichage élégant du solde principal
|
||||
/// Adaptatif dark/light via AppColors
|
||||
class UnionBalanceCard extends StatelessWidget {
|
||||
final String label;
|
||||
final String amount;
|
||||
@@ -20,14 +22,20 @@ class UnionBalanceCard extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final isDark = Theme.of(context).brightness == Brightness.dark;
|
||||
final bgColor = isDark ? AppColors.surfaceDark : AppColors.surface;
|
||||
final borderColor = isDark ? AppColors.borderDark : AppColors.border;
|
||||
final textPrimary = isDark ? AppColors.textPrimaryDark : AppColors.textPrimary;
|
||||
final textSecondary= isDark ? AppColors.textSecondaryDark: AppColors.textSecondary;
|
||||
|
||||
return GestureDetector(
|
||||
onTap: onTap,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: UnionFlowColors.surface,
|
||||
border: Border.all(color: UnionFlowColors.border),
|
||||
color: bgColor,
|
||||
border: Border.all(color: borderColor),
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
@@ -43,20 +51,20 @@ class UnionBalanceCard extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
label.toUpperCase(),
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 9,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: UnionFlowColors.textSecondary,
|
||||
color: textSecondary,
|
||||
letterSpacing: 0.8,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
amount,
|
||||
style: const TextStyle(
|
||||
style: TextStyle(
|
||||
fontSize: 22,
|
||||
fontWeight: FontWeight.w800,
|
||||
color: UnionFlowColors.textPrimary,
|
||||
color: textPrimary,
|
||||
height: 1,
|
||||
letterSpacing: -0.5,
|
||||
),
|
||||
@@ -76,8 +84,8 @@ class UnionBalanceCard extends StatelessWidget {
|
||||
: Icons.arrow_downward_rounded,
|
||||
size: 11,
|
||||
color: isTrendPositive == true
|
||||
? UnionFlowColors.success
|
||||
: UnionFlowColors.error,
|
||||
? AppColors.success
|
||||
: AppColors.error,
|
||||
),
|
||||
const SizedBox(width: 2),
|
||||
Text(
|
||||
@@ -86,15 +94,15 @@ class UnionBalanceCard extends StatelessWidget {
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: isTrendPositive == true
|
||||
? UnionFlowColors.success
|
||||
: UnionFlowColors.error,
|
||||
? AppColors.success
|
||||
: AppColors.error,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Text(
|
||||
Text(
|
||||
'ce mois',
|
||||
style: TextStyle(fontSize: 9, color: UnionFlowColors.textTertiary),
|
||||
style: TextStyle(fontSize: 9, color: textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user