Clean project: remove test files, debug logs, and add documentation
This commit is contained in:
@@ -0,0 +1,305 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../widgets/dashboard_widgets.dart';
|
||||
|
||||
/// Exemple de dashboard refactorisé utilisant les nouveaux composants
|
||||
///
|
||||
/// Ce fichier démontre comment créer un dashboard sophistiqué
|
||||
/// en utilisant les composants modulaires créés lors de la refactorisation.
|
||||
class ExampleRefactoredDashboard extends StatelessWidget {
|
||||
const ExampleRefactoredDashboard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: const Color(0xFFF8F9FA),
|
||||
body: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(12),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// En-tête avec informations système et actions
|
||||
DashboardHeader.superAdmin(
|
||||
actions: [
|
||||
DashboardAction(
|
||||
icon: Icons.refresh,
|
||||
tooltip: 'Actualiser',
|
||||
onPressed: () => _handleRefresh(context),
|
||||
),
|
||||
DashboardAction(
|
||||
icon: Icons.settings,
|
||||
tooltip: 'Paramètres',
|
||||
onPressed: () => _handleSettings(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Section des KPIs système
|
||||
QuickStatsSection.systemKPIs(
|
||||
onStatTap: (stat) => _handleStatTap(context, stat),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Carte de performance serveur
|
||||
PerformanceCard.server(
|
||||
onTap: () => _handlePerformanceTap(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Section des alertes récentes
|
||||
RecentActivitiesSection.alerts(
|
||||
onActivityTap: (activity) => _handleActivityTap(context, activity),
|
||||
onViewAll: () => _handleViewAllAlerts(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Section des activités système
|
||||
RecentActivitiesSection.system(
|
||||
onActivityTap: (activity) => _handleActivityTap(context, activity),
|
||||
onViewAll: () => _handleViewAllActivities(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Section des événements à venir
|
||||
UpcomingEventsSection.systemTasks(
|
||||
onEventTap: (event) => _handleEventTap(context, event),
|
||||
onViewAll: () => _handleViewAllEvents(context),
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Exemple de section personnalisée avec composants individuels
|
||||
_buildCustomSection(context),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Exemple de métriques de performance réseau
|
||||
PerformanceCard.network(
|
||||
onTap: () => _handleNetworkTap(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section personnalisée utilisant les composants de base
|
||||
Widget _buildCustomSection(BuildContext context) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader.section(
|
||||
title: 'Section Personnalisée',
|
||||
subtitle: 'Exemple d\'utilisation des composants de base',
|
||||
icon: Icons.extension,
|
||||
),
|
||||
|
||||
// Grille de statistiques personnalisées
|
||||
GridView.count(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
crossAxisCount: 2,
|
||||
crossAxisSpacing: 8,
|
||||
mainAxisSpacing: 8,
|
||||
childAspectRatio: 1.4,
|
||||
children: [
|
||||
StatCard(
|
||||
title: 'Connexions',
|
||||
value: '1,247',
|
||||
subtitle: 'Actives maintenant',
|
||||
icon: Icons.wifi,
|
||||
color: const Color(0xFF6C5CE7),
|
||||
onTap: () => _showSnackBar(context, 'Connexions tappées'),
|
||||
),
|
||||
StatCard(
|
||||
title: 'Erreurs',
|
||||
value: '3',
|
||||
subtitle: 'Dernière heure',
|
||||
icon: Icons.error_outline,
|
||||
color: Colors.red,
|
||||
onTap: () => _showSnackBar(context, 'Erreurs tappées'),
|
||||
),
|
||||
StatCard(
|
||||
title: 'Succès',
|
||||
value: '98.7%',
|
||||
subtitle: 'Taux de réussite',
|
||||
icon: Icons.check_circle_outline,
|
||||
color: const Color(0xFF00B894),
|
||||
onTap: () => _showSnackBar(context, 'Succès tappés'),
|
||||
),
|
||||
StatCard(
|
||||
title: 'Latence',
|
||||
value: '12ms',
|
||||
subtitle: 'Moyenne',
|
||||
icon: Icons.speed,
|
||||
color: Colors.orange,
|
||||
onTap: () => _showSnackBar(context, 'Latence tappée'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Liste d'activités personnalisées
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const SectionHeader.subsection(
|
||||
title: 'Activités Personnalisées',
|
||||
),
|
||||
ActivityItem.system(
|
||||
title: 'Configuration mise à jour',
|
||||
description: 'Paramètres de sécurité modifiés',
|
||||
timestamp: 'il y a 10min',
|
||||
onTap: () => _showSnackBar(context, 'Configuration tappée'),
|
||||
),
|
||||
ActivityItem.user(
|
||||
title: 'Nouvel administrateur',
|
||||
description: 'Jean Dupont ajouté comme admin',
|
||||
timestamp: 'il y a 1h',
|
||||
onTap: () => _showSnackBar(context, 'Administrateur tappé'),
|
||||
),
|
||||
ActivityItem.success(
|
||||
title: 'Sauvegarde terminée',
|
||||
description: 'Sauvegarde automatique réussie',
|
||||
timestamp: 'il y a 2h',
|
||||
onTap: () => _showSnackBar(context, 'Sauvegarde tappée'),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
// Gestionnaires d'événements
|
||||
void _handleRefresh(BuildContext context) {
|
||||
_showSnackBar(context, 'Actualisation en cours...');
|
||||
}
|
||||
|
||||
void _handleSettings(BuildContext context) {
|
||||
_showSnackBar(context, 'Ouverture des paramètres...');
|
||||
}
|
||||
|
||||
void _handleStatTap(BuildContext context, QuickStat stat) {
|
||||
_showSnackBar(context, 'Statistique tappée: ${stat.title}');
|
||||
}
|
||||
|
||||
void _handlePerformanceTap(BuildContext context) {
|
||||
_showSnackBar(context, 'Ouverture des détails de performance...');
|
||||
}
|
||||
|
||||
void _handleActivityTap(BuildContext context, RecentActivity activity) {
|
||||
_showSnackBar(context, 'Activité tappée: ${activity.title}');
|
||||
}
|
||||
|
||||
void _handleEventTap(BuildContext context, UpcomingEvent event) {
|
||||
_showSnackBar(context, 'Événement tappé: ${event.title}');
|
||||
}
|
||||
|
||||
void _handleViewAllAlerts(BuildContext context) {
|
||||
_showSnackBar(context, 'Affichage de toutes les alertes...');
|
||||
}
|
||||
|
||||
void _handleViewAllActivities(BuildContext context) {
|
||||
_showSnackBar(context, 'Affichage de toutes les activités...');
|
||||
}
|
||||
|
||||
void _handleViewAllEvents(BuildContext context) {
|
||||
_showSnackBar(context, 'Affichage de tous les événements...');
|
||||
}
|
||||
|
||||
void _handleNetworkTap(BuildContext context) {
|
||||
_showSnackBar(context, 'Ouverture des métriques réseau...');
|
||||
}
|
||||
|
||||
void _showSnackBar(BuildContext context, String message) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(message),
|
||||
backgroundColor: const Color(0xFF6C5CE7),
|
||||
duration: const Duration(seconds: 2),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Widget de démonstration pour tester les composants
|
||||
class DashboardComponentsDemo extends StatelessWidget {
|
||||
const DashboardComponentsDemo({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Démo Composants Dashboard'),
|
||||
backgroundColor: const Color(0xFF6C5CE7),
|
||||
foregroundColor: Colors.white,
|
||||
),
|
||||
body: const SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SectionHeader.primary(
|
||||
title: 'Démonstration des Composants',
|
||||
subtitle: 'Tous les widgets refactorisés',
|
||||
icon: Icons.widgets,
|
||||
),
|
||||
|
||||
SectionHeader.section(
|
||||
title: 'En-têtes de Dashboard',
|
||||
),
|
||||
DashboardHeader.superAdmin(),
|
||||
SizedBox(height: 16),
|
||||
DashboardHeader.orgAdmin(),
|
||||
SizedBox(height: 16),
|
||||
DashboardHeader.member(),
|
||||
SizedBox(height: 24),
|
||||
|
||||
SectionHeader.section(
|
||||
title: 'Sections de Statistiques',
|
||||
),
|
||||
QuickStatsSection.systemKPIs(),
|
||||
SizedBox(height: 16),
|
||||
QuickStatsSection.organizationStats(),
|
||||
SizedBox(height: 24),
|
||||
|
||||
SectionHeader.section(
|
||||
title: 'Cartes de Performance',
|
||||
),
|
||||
PerformanceCard.server(),
|
||||
SizedBox(height: 16),
|
||||
PerformanceCard.network(),
|
||||
SizedBox(height: 24),
|
||||
|
||||
SectionHeader.section(
|
||||
title: 'Sections d\'Activités',
|
||||
),
|
||||
RecentActivitiesSection.system(),
|
||||
SizedBox(height: 16),
|
||||
RecentActivitiesSection.alerts(),
|
||||
SizedBox(height: 24),
|
||||
|
||||
SectionHeader.section(
|
||||
title: 'Événements à Venir',
|
||||
),
|
||||
UpcomingEventsSection.organization(),
|
||||
SizedBox(height: 16),
|
||||
UpcomingEventsSection.systemTasks(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -184,26 +184,26 @@ class ModeratorDashboard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
child: const Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const CircleAvatar(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Color(0xFFFFE0E0),
|
||||
child: Icon(Icons.flag, color: Color(0xFFD63031)),
|
||||
),
|
||||
title: const Text('Contenu inapproprié signalé'),
|
||||
subtitle: const Text('Commentaire sur événement'),
|
||||
trailing: const Text('Urgent'),
|
||||
title: Text('Contenu inapproprié signalé'),
|
||||
subtitle: Text('Commentaire sur événement'),
|
||||
trailing: Text('Urgent'),
|
||||
),
|
||||
const Divider(height: 1),
|
||||
Divider(height: 1),
|
||||
ListTile(
|
||||
leading: const CircleAvatar(
|
||||
leading: CircleAvatar(
|
||||
backgroundColor: Color(0xFFFFF3E0),
|
||||
child: Icon(Icons.person_add, color: Color(0xFFE17055)),
|
||||
),
|
||||
title: const Text('Demande d\'adhésion'),
|
||||
subtitle: const Text('Marie Dubois'),
|
||||
trailing: const Text('2j'),
|
||||
title: Text('Demande d\'adhésion'),
|
||||
subtitle: Text('Marie Dubois'),
|
||||
trailing: Text('2j'),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -214,19 +214,19 @@ class ModeratorDashboard extends StatelessWidget {
|
||||
|
||||
Widget _buildRecentActivity() {
|
||||
return DashboardRecentActivitySection(
|
||||
activities: [
|
||||
activities: const [
|
||||
DashboardActivity(
|
||||
title: 'Signalement traité',
|
||||
subtitle: 'Contenu supprimé',
|
||||
icon: Icons.check_circle,
|
||||
color: const Color(0xFF00B894),
|
||||
color: Color(0xFF00B894),
|
||||
time: 'Il y a 1h',
|
||||
),
|
||||
DashboardActivity(
|
||||
title: 'Membre suspendu',
|
||||
subtitle: 'Violation des règles',
|
||||
icon: Icons.person_remove,
|
||||
color: const Color(0xFFD63031),
|
||||
color: Color(0xFFD63031),
|
||||
time: 'Il y a 3h',
|
||||
),
|
||||
],
|
||||
|
||||
@@ -4,7 +4,7 @@ library org_admin_dashboard;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../../core/design_system/tokens/tokens.dart';
|
||||
import '../../widgets/widgets.dart';
|
||||
import '../../widgets/dashboard_widgets.dart';
|
||||
|
||||
|
||||
/// Dashboard Control Panel pour Administrateur d'Organisation
|
||||
@@ -236,52 +236,7 @@ class _OrgAdminDashboardState extends State<OrgAdminDashboard> {
|
||||
|
||||
/// Section métriques organisation
|
||||
Widget _buildOrganizationMetricsSection() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Vue d\'ensemble Organisation',
|
||||
style: TypographyTokens.headlineMedium.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
|
||||
DashboardStatsGrid(
|
||||
stats: [
|
||||
DashboardStat(
|
||||
icon: Icons.people,
|
||||
value: '156',
|
||||
title: 'Membres Actifs',
|
||||
color: const Color(0xFF00B894),
|
||||
onTap: () => _onStatTap('members'),
|
||||
),
|
||||
DashboardStat(
|
||||
icon: Icons.euro,
|
||||
value: '12,450€',
|
||||
title: 'Budget Mensuel',
|
||||
color: const Color(0xFF0984E3),
|
||||
onTap: () => _onStatTap('budget'),
|
||||
),
|
||||
DashboardStat(
|
||||
icon: Icons.event,
|
||||
value: '8',
|
||||
title: 'Événements',
|
||||
color: const Color(0xFFE17055),
|
||||
onTap: () => _onStatTap('events'),
|
||||
),
|
||||
DashboardStat(
|
||||
icon: Icons.trending_up,
|
||||
value: '94%',
|
||||
title: 'Satisfaction',
|
||||
color: const Color(0xFF00CEC9),
|
||||
onTap: () => _onStatTap('satisfaction'),
|
||||
),
|
||||
],
|
||||
onStatTap: _onStatTap,
|
||||
),
|
||||
],
|
||||
);
|
||||
return const QuickStatsSection.organizationStats();
|
||||
}
|
||||
|
||||
/// Section actions rapides admin
|
||||
@@ -526,29 +481,9 @@ class _OrgAdminDashboardState extends State<OrgAdminDashboard> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
|
||||
const DashboardInsightsSection(
|
||||
metrics: [
|
||||
DashboardMetric(
|
||||
label: 'Cotisations collectées',
|
||||
value: '89%',
|
||||
progress: 0.89,
|
||||
color: Color(0xFF00B894),
|
||||
),
|
||||
DashboardMetric(
|
||||
label: 'Budget utilisé',
|
||||
value: '67%',
|
||||
progress: 0.67,
|
||||
color: Color(0xFF0984E3),
|
||||
),
|
||||
DashboardMetric(
|
||||
label: 'Objectif annuel',
|
||||
value: '78%',
|
||||
progress: 0.78,
|
||||
color: Color(0xFFE17055),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
// Remplacé par PerformanceCard pour les métriques
|
||||
const PerformanceCard.server(),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -565,33 +500,9 @@ class _OrgAdminDashboardState extends State<OrgAdminDashboard> {
|
||||
),
|
||||
),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
|
||||
DashboardRecentActivitySection(
|
||||
activities: const [
|
||||
DashboardActivity(
|
||||
title: 'Nouveau membre approuvé',
|
||||
subtitle: 'Sophie Laurent rejoint l\'organisation',
|
||||
icon: Icons.person_add,
|
||||
color: Color(0xFF00B894),
|
||||
time: 'Il y a 2h',
|
||||
),
|
||||
DashboardActivity(
|
||||
title: 'Budget mis à jour',
|
||||
subtitle: 'Allocation événements modifiée',
|
||||
icon: Icons.account_balance_wallet,
|
||||
color: Color(0xFF0984E3),
|
||||
time: 'Il y a 4h',
|
||||
),
|
||||
DashboardActivity(
|
||||
title: 'Rapport généré',
|
||||
subtitle: 'Rapport mensuel d\'activité',
|
||||
icon: Icons.assessment,
|
||||
color: Color(0xFF6C5CE7),
|
||||
time: 'Il y a 1j',
|
||||
),
|
||||
],
|
||||
onActivityTap: (activityId) => _onActivityTap(activityId),
|
||||
),
|
||||
|
||||
// Remplacé par RecentActivitiesSection
|
||||
const RecentActivitiesSection.organization(),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
@@ -340,26 +340,26 @@ class SimpleMemberDashboard extends StatelessWidget {
|
||||
),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
DashboardRecentActivitySection(
|
||||
activities: [
|
||||
activities: const [
|
||||
DashboardActivity(
|
||||
title: 'Cotisation payée',
|
||||
subtitle: 'Décembre 2024',
|
||||
icon: Icons.payment,
|
||||
color: const Color(0xFF00B894),
|
||||
color: Color(0xFF00B894),
|
||||
time: 'Il y a 1j',
|
||||
),
|
||||
DashboardActivity(
|
||||
title: 'Profil mis à jour',
|
||||
subtitle: 'Informations personnelles',
|
||||
icon: Icons.edit,
|
||||
color: const Color(0xFF00CEC9),
|
||||
color: Color(0xFF00CEC9),
|
||||
time: 'Il y a 1 sem',
|
||||
),
|
||||
DashboardActivity(
|
||||
title: 'Inscription événement',
|
||||
subtitle: 'Assemblée Générale',
|
||||
icon: Icons.event,
|
||||
color: const Color(0xFF0984E3),
|
||||
color: Color(0xFF0984E3),
|
||||
time: 'Il y a 2 sem',
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../widgets/dashboard_widgets.dart';
|
||||
|
||||
|
||||
|
||||
@@ -37,24 +38,24 @@ class _SuperAdminDashboardState extends State<SuperAdminDashboard> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
// Header avec heure et statut système
|
||||
_buildSystemStatusHeader(),
|
||||
// Header avec informations système
|
||||
const DashboardHeader.superAdmin(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// KPIs système en temps réel
|
||||
_buildSimpleKPIsSection(),
|
||||
const QuickStatsSection.systemKPIs(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Performance serveur
|
||||
_buildSimpleServerSection(),
|
||||
const PerformanceCard.server(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Alertes importantes
|
||||
_buildSimpleAlertsSection(),
|
||||
const RecentActivitiesSection.alerts(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Activité récente
|
||||
_buildSimpleActivitySection(),
|
||||
const RecentActivitiesSection.system(),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Actions rapides système
|
||||
@@ -64,330 +65,17 @@ class _SuperAdminDashboardState extends State<SuperAdminDashboard> {
|
||||
);
|
||||
}
|
||||
|
||||
/// Section KPIs simplifiée
|
||||
Widget _buildSimpleKPIsSection() {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Métriques Système',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF6C5CE7),
|
||||
fontSize: 20,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildSimpleKPICard(
|
||||
'Organisations',
|
||||
'247',
|
||||
'+12 ce mois',
|
||||
Icons.business,
|
||||
const Color(0xFF0984E3),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: _buildSimpleKPICard(
|
||||
'Utilisateurs',
|
||||
'15,847',
|
||||
'+1,234 ce mois',
|
||||
Icons.people,
|
||||
const Color(0xFF00B894),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: _buildSimpleKPICard(
|
||||
'Uptime',
|
||||
'99.97%',
|
||||
'30 derniers jours',
|
||||
Icons.trending_up,
|
||||
const Color(0xFF00CEC9),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: _buildSimpleKPICard(
|
||||
'Temps Réponse',
|
||||
'1.2s',
|
||||
'Moyenne 24h',
|
||||
Icons.speed,
|
||||
const Color(0xFFE17055),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// Carte KPI simplifiée
|
||||
Widget _buildSimpleKPICard(
|
||||
String title,
|
||||
String value,
|
||||
String subtitle,
|
||||
IconData icon,
|
||||
Color color,
|
||||
) {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(icon, color: color, size: 20),
|
||||
const Spacer(),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: color,
|
||||
fontSize: 18,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: Colors.black87,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
subtitle,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Section serveur simplifiée
|
||||
Widget _buildSimpleServerSection() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Performance Serveur',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF6C5CE7),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildMetricRow('CPU', '67.3%', Colors.orange),
|
||||
const SizedBox(height: 8),
|
||||
_buildMetricRow('RAM', '12.4 GB / 16 GB', Colors.blue),
|
||||
const SizedBox(height: 8),
|
||||
_buildMetricRow('Disque', '847 GB / 1 TB', Colors.red),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Ligne de métrique
|
||||
Widget _buildMetricRow(String label, String value, Color color) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: BoxDecoration(
|
||||
color: color,
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
label,
|
||||
style: const TextStyle(fontWeight: FontWeight.w600),
|
||||
),
|
||||
const Spacer(),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
color: color,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// Section alertes simplifiée
|
||||
Widget _buildSimpleAlertsSection() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Alertes Système',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF6C5CE7),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildAlertRow('Charge CPU élevée', 'Serveur principal', Colors.orange),
|
||||
const SizedBox(height: 8),
|
||||
_buildAlertRow('Espace disque faible', 'Base de données', Colors.red),
|
||||
const SizedBox(height: 8),
|
||||
_buildAlertRow('Connexions élevées', 'Load balancer', Colors.amber),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Ligne d'alerte
|
||||
Widget _buildAlertRow(String title, String source, Color color) {
|
||||
return Row(
|
||||
children: [
|
||||
Icon(Icons.warning, color: color, size: 16),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
source,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
/// Section activité simplifiée
|
||||
Widget _buildSimpleActivitySection() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.05),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Activité Récente',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF6C5CE7),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildActivityRow('Nouvelle organisation créée', 'il y a 2h'),
|
||||
const SizedBox(height: 8),
|
||||
_buildActivityRow('Utilisateur connecté', 'il y a 5min'),
|
||||
const SizedBox(height: 8),
|
||||
_buildActivityRow('Sauvegarde terminée', 'il y a 1h'),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Ligne d'activité
|
||||
Widget _buildActivityRow(String title, String time) {
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF6C5CE7),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
title,
|
||||
style: const TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
time,
|
||||
style: const TextStyle(
|
||||
color: Colors.grey,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// Organisations Content
|
||||
Widget _buildOrganizationsContent() {
|
||||
@@ -942,83 +630,7 @@ class _SuperAdminDashboardState extends State<SuperAdminDashboard> {
|
||||
|
||||
|
||||
|
||||
/// Header avec statut système et heure
|
||||
Widget _buildSystemStatusHeader() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF6C5CE7), Color(0xFF5A4FCF)],
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: const Color(0xFF6C5CE7).withOpacity(0.3),
|
||||
blurRadius: 15,
|
||||
offset: const Offset(0, 5),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Système Opérationnel',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Dernière mise à jour: ${DateTime.now().hour.toString().padLeft(2, '0')}:${DateTime.now().minute.toString().padLeft(2, '0')}',
|
||||
style: TextStyle(
|
||||
color: Colors.white.withOpacity(0.8),
|
||||
fontSize: 12,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Container(
|
||||
width: 8,
|
||||
height: 8,
|
||||
decoration: const BoxDecoration(
|
||||
color: Color(0xFF00B894),
|
||||
shape: BoxShape.circle,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 6),
|
||||
const Text(
|
||||
'En ligne',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/// Actions rapides système
|
||||
Widget _buildSystemQuickActions() {
|
||||
|
||||
@@ -4,7 +4,6 @@ library visitor_dashboard;
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import '../../../../../core/design_system/tokens/tokens.dart';
|
||||
import '../../widgets/widgets.dart';
|
||||
|
||||
/// Dashboard Landing Experience pour Visiteur
|
||||
class VisitorDashboard extends StatelessWidget {
|
||||
@@ -219,7 +218,7 @@ class VisitorDashboard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
const SizedBox(height: SpacingTokens.md),
|
||||
Text(
|
||||
const Text(
|
||||
'Nous sommes une association dynamique qui rassemble les passionnés de technologie. Notre mission est de favoriser l\'apprentissage, le partage de connaissances et l\'entraide dans le domaine du développement.',
|
||||
style: TypographyTokens.bodyMedium,
|
||||
),
|
||||
@@ -490,24 +489,24 @@ class VisitorDashboard extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
child: const Column(
|
||||
children: [
|
||||
ListTile(
|
||||
leading: const Icon(Icons.email, color: Color(0xFF6C5CE7)),
|
||||
title: const Text('Email'),
|
||||
subtitle: const Text('contact@association-dev.fr'),
|
||||
leading: Icon(Icons.email, color: Color(0xFF6C5CE7)),
|
||||
title: Text('Email'),
|
||||
subtitle: Text('contact@association-dev.fr'),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.phone, color: Color(0xFF6C5CE7)),
|
||||
title: const Text('Téléphone'),
|
||||
subtitle: const Text('+33 1 23 45 67 89'),
|
||||
leading: Icon(Icons.phone, color: Color(0xFF6C5CE7)),
|
||||
title: Text('Téléphone'),
|
||||
subtitle: Text('+33 1 23 45 67 89'),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.location_on, color: Color(0xFF6C5CE7)),
|
||||
title: const Text('Adresse'),
|
||||
subtitle: const Text('123 Rue de la Tech, 75001 Paris'),
|
||||
leading: Icon(Icons.location_on, color: Color(0xFF6C5CE7)),
|
||||
title: Text('Adresse'),
|
||||
subtitle: Text('123 Rue de la Tech, 75001 Paris'),
|
||||
contentPadding: EdgeInsets.zero,
|
||||
),
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user