refactoring

This commit is contained in:
dahoud
2026-03-31 09:14:47 +00:00
parent 9bfffeeebe
commit 5383df6dcb
200 changed files with 11192 additions and 7063 deletions

View File

@@ -49,14 +49,14 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: UnionFlowColors.background,
backgroundColor: AppColors.lightBackground,
appBar: _buildAppBar(),
body: AfricanPatternBackground(
child: BlocBuilder<DashboardBloc, DashboardState>(
builder: (context, state) {
if (state is DashboardLoading) {
return const Center(
child: CircularProgressIndicator(color: UnionFlowColors.unionGreen),
child: CircularProgressIndicator(color: AppColors.primaryGreen),
);
}
@@ -81,7 +81,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
PreferredSizeWidget _buildAppBar() {
return AppBar(
backgroundColor: UnionFlowColors.surface,
backgroundColor: AppColors.lightSurface,
elevation: 0,
title: Row(
children: [
@@ -114,7 +114,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w700,
color: UnionFlowColors.textPrimary,
color: AppColors.textPrimaryLight,
),
),
Text(
@@ -122,7 +122,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w400,
color: UnionFlowColors.textSecondary,
color: AppColors.textSecondaryLight,
),
),
],
@@ -148,7 +148,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
count: _unreadNotifications,
child: IconButton(
icon: const Icon(Icons.notifications_outlined),
color: UnionFlowColors.textPrimary,
color: AppColors.textPrimaryLight,
onPressed: () {
setState(() => _unreadNotifications = 0);
UnionNotificationToast.show(
@@ -165,9 +165,9 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
],
bottom: TabBar(
controller: _tabController,
labelColor: UnionFlowColors.unionGreen,
unselectedLabelColor: UnionFlowColors.textSecondary,
indicatorColor: UnionFlowColors.unionGreen,
labelColor: AppColors.primaryGreen,
unselectedLabelColor: AppColors.textSecondaryLight,
indicatorColor: AppColors.primaryGreen,
labelStyle: const TextStyle(fontSize: 13, fontWeight: FontWeight.w700),
tabs: const [
Tab(text: 'Vue d\'ensemble'),
@@ -188,7 +188,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
userId: widget.userId,
));
},
color: UnionFlowColors.unionGreen,
color: AppColors.primaryGreen,
child: TabBarView(
controller: _tabController,
children: [
@@ -216,7 +216,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
final stats = data.stats;
return SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(24),
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -242,7 +242,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
label: 'Membres',
value: stats.totalMembers.toString(),
icon: Icons.people_outline,
color: UnionFlowColors.unionGreen,
color: AppColors.primaryGreen,
trend: '+8%',
isTrendUp: true,
),
@@ -288,7 +288,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
],
),
),
const SizedBox(height: 24),
const SizedBox(height: 12),
// Progression - Animée
AnimatedFadeIn(
@@ -299,7 +299,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
subtitle: '70% des membres ont cotisé ce mois',
),
),
const SizedBox(height: 24),
const SizedBox(height: 12),
// Actions rapides - Animées
AnimatedSlideIn(
@@ -316,7 +316,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
);
},
backgroundColor: UnionFlowColors.unionGreenPale,
iconColor: UnionFlowColors.unionGreen,
iconColor: AppColors.primaryGreen,
),
UnionActionButton(
icon: Icons.send,
@@ -354,7 +354,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
],
),
),
const SizedBox(height: 24),
const SizedBox(height: 12),
// Activité récente - Animée
AnimatedFadeIn(
@@ -382,7 +382,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
final taux = (stats.engagementRate * 100).toStringAsFixed(0);
return SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(24),
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -398,7 +398,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
title: 'Période mise à jour',
message: 'Affichage pour ${period.label.toLowerCase()}',
icon: Icons.calendar_today,
color: UnionFlowColors.unionGreen,
color: AppColors.primaryGreen,
);
},
),
@@ -425,7 +425,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
sections: [
UnionPieChartSection.create(
value: 40,
color: UnionFlowColors.unionGreen,
color: AppColors.primaryGreen,
title: '40%\nCotisations',
),
UnionPieChartSection.create(
@@ -446,7 +446,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
],
),
),
const SizedBox(height: 24),
const SizedBox(height: 12),
// Titre
AnimatedFadeIn(
@@ -454,13 +454,13 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
child: const Text(
'Métriques Financières',
style: TextStyle(
fontSize: 16,
fontSize: 13,
fontWeight: FontWeight.w700,
color: UnionFlowColors.textPrimary,
color: AppColors.textPrimaryLight,
),
),
),
const SizedBox(height: 16),
const SizedBox(height: 8),
// Métriques - Animées (données backend)
AnimatedSlideIn(
@@ -523,7 +523,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
final tiles = data.recentActivities.map((a) => _activityToTile(a)).toList();
return SingleChildScrollView(
physics: const AlwaysScrollableScrollPhysics(),
padding: const EdgeInsets.all(24),
padding: const EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -582,21 +582,20 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
Widget _buildFinanceMetric(String label, String value, IconData icon, Color color) {
return Container(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.all(10),
decoration: BoxDecoration(
color: UnionFlowColors.surface,
borderRadius: BorderRadius.circular(16),
boxShadow: UnionFlowColors.softShadow,
color: AppColors.lightSurface,
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
Container(
padding: const EdgeInsets.all(10),
padding: const EdgeInsets.all(7),
decoration: BoxDecoration(
color: color.withOpacity(0.1),
borderRadius: BorderRadius.circular(12),
borderRadius: BorderRadius.circular(8),
),
child: Icon(icon, size: 24, color: color),
child: Icon(icon, size: 16, color: color),
),
const SizedBox(width: 12),
Expanded(
@@ -608,14 +607,14 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
style: const TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
color: UnionFlowColors.textSecondary,
color: AppColors.textSecondaryLight,
),
),
const SizedBox(height: 4),
Text(
value,
style: TextStyle(
fontSize: 16,
fontSize: 13,
fontWeight: FontWeight.w700,
color: color,
),
@@ -631,62 +630,62 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
Widget _buildMemberNotRegisteredState() {
return Center(
child: Padding(
padding: const EdgeInsets.all(32),
padding: const EdgeInsets.all(24),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.all(28),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
gradient: UnionFlowColors.primaryGradient,
shape: BoxShape.circle,
),
child: const Icon(
Icons.person_add_alt_1_outlined,
size: 56,
size: 36,
color: Colors.white,
),
),
const SizedBox(height: 28),
const SizedBox(height: 14),
const Text(
'Bienvenue dans UnionFlow',
style: TextStyle(
fontSize: 20,
fontSize: 15,
fontWeight: FontWeight.w800,
color: UnionFlowColors.textPrimary,
color: AppColors.textPrimaryLight,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 12),
const SizedBox(height: 8),
const Text(
'Votre compte est en cours de configuration par un administrateur. '
'Votre tableau de bord sera disponible dès que votre profil membre aura été activé.',
style: TextStyle(
fontSize: 14,
color: UnionFlowColors.textSecondary,
fontSize: 12,
color: AppColors.textSecondaryLight,
height: 1.5,
),
textAlign: TextAlign.center,
),
const SizedBox(height: 32),
const SizedBox(height: 16),
Container(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14),
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: UnionFlowColors.unionGreen.withOpacity(0.08),
borderRadius: BorderRadius.circular(12),
border: Border.all(color: UnionFlowColors.unionGreen.withOpacity(0.3)),
color: AppColors.primaryGreen.withOpacity(0.08),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: AppColors.primaryGreen.withOpacity(0.3)),
),
child: const Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(Icons.info_outline, size: 18, color: UnionFlowColors.unionGreen),
Icon(Icons.info_outline, size: 18, color: AppColors.primaryGreen),
SizedBox(width: 10),
Flexible(
child: Text(
'Contactez votre administrateur si ce message persiste.',
style: TextStyle(
fontSize: 13,
color: UnionFlowColors.unionGreen,
color: AppColors.primaryGreen,
fontWeight: FontWeight.w500,
),
),
@@ -707,24 +706,24 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding: const EdgeInsets.all(24),
padding: const EdgeInsets.all(16),
decoration: BoxDecoration(
color: UnionFlowColors.errorPale,
shape: BoxShape.circle,
),
child: const Icon(
Icons.error_outline,
size: 64,
size: 40,
color: UnionFlowColors.error,
),
),
const SizedBox(height: 24),
const SizedBox(height: 12),
const Text(
'Erreur de chargement',
style: TextStyle(
fontSize: 16,
fontSize: 13,
fontWeight: FontWeight.w700,
color: UnionFlowColors.textPrimary,
color: AppColors.textPrimaryLight,
),
),
const SizedBox(height: 8),
@@ -732,7 +731,7 @@ class _ConnectedDashboardPageState extends State<ConnectedDashboardPage> with Si
message,
style: const TextStyle(
fontSize: 13,
color: UnionFlowColors.textSecondary,
color: AppColors.textSecondaryLight,
),
textAlign: TextAlign.center,
),