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:
@@ -2,6 +2,7 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import '../design_system/tokens/app_colors.dart';
|
||||
|
||||
/// Widget réutilisable pour uploader un fichier (image ou PDF)
|
||||
/// avec prévisualisation et validation
|
||||
@@ -105,7 +106,7 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: Colors.red,
|
||||
backgroundColor: AppColors.error,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -179,7 +180,7 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
),
|
||||
if (_selectedFile != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.delete, color: Colors.red),
|
||||
icon: const Icon(Icons.delete, color: AppColors.error),
|
||||
onPressed: _removeFile,
|
||||
),
|
||||
],
|
||||
@@ -202,7 +203,7 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
border: Border.all(color: AppColors.borderStrong),
|
||||
),
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -218,13 +219,13 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
width: double.infinity,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
border: Border.all(color: AppColors.borderStrong),
|
||||
),
|
||||
child: const Center(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(Icons.picture_as_pdf, size: 48, color: Colors.red),
|
||||
Icon(Icons.picture_as_pdf, size: 48, color: AppColors.error),
|
||||
SizedBox(height: 8),
|
||||
Text('Document PDF'),
|
||||
],
|
||||
@@ -234,7 +235,11 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
_selectedFile!.path.split('/').last,
|
||||
style: TextStyle(color: Colors.grey.shade700),
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).brightness == Brightness.dark
|
||||
? AppColors.textSecondaryDark
|
||||
: AppColors.textSecondary,
|
||||
),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
@@ -244,7 +249,7 @@ class _FileUploadWidgetState extends State<FileUploadWidget> {
|
||||
'Formats acceptés: JPEG, PNG, PDF (max 5 MB)',
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.shade600,
|
||||
color: AppColors.textTertiary,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user