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,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../tokens/app_colors.dart';
|
||||
import '../tokens/unionflow_colors.dart';
|
||||
|
||||
/// Ligne d'activité récente — style fintech compact identique au super_admin
|
||||
/// Icône dans carré arrondi 28×28 + titre + description + timestamp
|
||||
/// Ligne d'activité récente — style fintech compact
|
||||
/// Adaptatif dark/light via AppColors
|
||||
class DashboardActivityRow extends StatelessWidget {
|
||||
final String title;
|
||||
final String description;
|
||||
@@ -21,13 +22,20 @@ class DashboardActivityRow 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;
|
||||
final textTertiary = isDark ? AppColors.textSecondaryDark: AppColors.textTertiary;
|
||||
|
||||
return Container(
|
||||
margin: const EdgeInsets.only(bottom: 6),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 9),
|
||||
decoration: BoxDecoration(
|
||||
color: UnionFlowColors.surface,
|
||||
color: bgColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: UnionFlowColors.border),
|
||||
border: Border.all(color: borderColor),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -35,7 +43,7 @@ class DashboardActivityRow extends StatelessWidget {
|
||||
width: 28,
|
||||
height: 28,
|
||||
decoration: BoxDecoration(
|
||||
color: color.withOpacity(0.12),
|
||||
color: color.withOpacity(isDark ? 0.2 : 0.12),
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
),
|
||||
child: Icon(icon, size: 14, color: color),
|
||||
@@ -47,20 +55,13 @@ class DashboardActivityRow extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: UnionFlowColors.textPrimary,
|
||||
),
|
||||
style: TextStyle(fontSize: 12, fontWeight: FontWeight.w600, color: textPrimary),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
style: const TextStyle(
|
||||
fontSize: 10,
|
||||
color: UnionFlowColors.textSecondary,
|
||||
),
|
||||
style: TextStyle(fontSize: 10, color: textSecondary),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -68,10 +69,7 @@ class DashboardActivityRow extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
timeAgo,
|
||||
style: const TextStyle(fontSize: 10, color: UnionFlowColors.textTertiary),
|
||||
),
|
||||
Text(timeAgo, style: TextStyle(fontSize: 10, color: textTertiary)),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -80,28 +78,20 @@ class DashboardActivityRow extends StatelessWidget {
|
||||
/// Icône selon le type d'activité
|
||||
static IconData iconFor(String type) {
|
||||
switch (type) {
|
||||
case 'member':
|
||||
return Icons.person_add_rounded;
|
||||
case 'event':
|
||||
return Icons.event_rounded;
|
||||
case 'contribution':
|
||||
return Icons.payments_rounded;
|
||||
default:
|
||||
return Icons.circle_notifications_rounded;
|
||||
case 'member': return Icons.person_add_rounded;
|
||||
case 'event': return Icons.event_rounded;
|
||||
case 'contribution': return Icons.payments_rounded;
|
||||
default: return Icons.circle_notifications_rounded;
|
||||
}
|
||||
}
|
||||
|
||||
/// Couleur selon le type d'activité
|
||||
static Color colorFor(String type) {
|
||||
switch (type) {
|
||||
case 'member':
|
||||
return UnionFlowColors.unionGreen;
|
||||
case 'event':
|
||||
return UnionFlowColors.info;
|
||||
case 'contribution':
|
||||
return UnionFlowColors.gold;
|
||||
default:
|
||||
return UnionFlowColors.textSecondary;
|
||||
case 'member': return UnionFlowColors.unionGreen;
|
||||
case 'event': return UnionFlowColors.info;
|
||||
case 'contribution': return UnionFlowColors.gold;
|
||||
default: return AppColors.textSecondary;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user