179 lines
5.1 KiB
Dart
179 lines
5.1 KiB
Dart
/// Dashboard Page Stable - Redirecteur vers Dashboard Adaptatif
|
|
/// Redirige automatiquement vers le nouveau système de dashboard adaptatif
|
|
library dashboard_page_stable;
|
|
|
|
import 'package:flutter/material.dart';
|
|
import 'adaptive_dashboard_page.dart';
|
|
|
|
/// Page Dashboard Stable - Maintenant un redirecteur
|
|
///
|
|
/// Cette page redirige automatiquement vers le nouveau système
|
|
/// de dashboard adaptatif basé sur les rôles utilisateurs.
|
|
class DashboardPageStable extends StatefulWidget {
|
|
const DashboardPageStable({super.key});
|
|
|
|
@override
|
|
State<DashboardPageStable> createState() => _DashboardPageStableState();
|
|
}
|
|
|
|
class _DashboardPageStableState extends State<DashboardPageStable> {
|
|
final GlobalKey<RefreshIndicatorState> _refreshKey = GlobalKey<RefreshIndicatorState>();
|
|
bool _isLoading = false;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: ColorTokens.surface,
|
|
appBar: AppBar(
|
|
title: Text(
|
|
'UnionFlow Dashboard',
|
|
style: TypographyTokens.headlineSmall.copyWith(
|
|
fontWeight: FontWeight.w700,
|
|
color: ColorTokens.onSurface,
|
|
),
|
|
),
|
|
backgroundColor: ColorTokens.surface,
|
|
elevation: 0,
|
|
actions: [
|
|
IconButton(
|
|
onPressed: () => _showNotifications(),
|
|
icon: const Icon(Icons.notifications_outlined),
|
|
tooltip: 'Notifications',
|
|
),
|
|
IconButton(
|
|
onPressed: () => _showSettings(),
|
|
icon: const Icon(Icons.settings_outlined),
|
|
tooltip: 'Paramètres',
|
|
),
|
|
],
|
|
),
|
|
drawer: DashboardDrawer(
|
|
onNavigate: _onNavigate,
|
|
onLogout: _onLogout,
|
|
),
|
|
body: RefreshIndicator(
|
|
key: _refreshKey,
|
|
onRefresh: _refreshData,
|
|
child: SingleChildScrollView(
|
|
padding: const EdgeInsets.all(SpacingTokens.md),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
// Message de bienvenue
|
|
DashboardWelcomeSection(
|
|
title: 'Bienvenue sur UnionFlow',
|
|
subtitle: 'Votre plateforme de gestion d\'union familiale',
|
|
),
|
|
|
|
const SizedBox(height: SpacingTokens.xl),
|
|
|
|
// Statistiques
|
|
DashboardStatsGrid(
|
|
onStatTap: _onStatTap,
|
|
),
|
|
|
|
const SizedBox(height: SpacingTokens.xl),
|
|
|
|
// Actions rapides
|
|
DashboardQuickActionsGrid(
|
|
onActionTap: _onActionTap,
|
|
),
|
|
|
|
const SizedBox(height: SpacingTokens.xl),
|
|
|
|
// Activité récente
|
|
DashboardRecentActivitySection(
|
|
onActivityTap: _onActivityTap,
|
|
),
|
|
|
|
const SizedBox(height: SpacingTokens.xl),
|
|
|
|
// Insights
|
|
DashboardInsightsSection(
|
|
onMetricTap: _onMetricTap,
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
// === CALLBACKS POUR LES WIDGETS MODULAIRES ===
|
|
|
|
/// Callback pour les actions sur les statistiques
|
|
void _onStatTap(String statType) {
|
|
debugPrint('Statistique tapée: $statType');
|
|
// TODO: Implémenter la navigation vers les détails
|
|
}
|
|
|
|
/// Callback pour les actions rapides
|
|
void _onActionTap(String actionType) {
|
|
debugPrint('Action rapide: $actionType');
|
|
// TODO: Implémenter les actions spécifiques
|
|
}
|
|
|
|
/// Callback pour les activités récentes
|
|
void _onActivityTap(String activityId) {
|
|
debugPrint('Activité tapée: $activityId');
|
|
// TODO: Implémenter la navigation vers les détails
|
|
}
|
|
|
|
/// Callback pour les métriques d'insights
|
|
void _onMetricTap(String metricType) {
|
|
debugPrint('Métrique tapée: $metricType');
|
|
// TODO: Implémenter la navigation vers les rapports
|
|
}
|
|
|
|
/// Callback pour la navigation du drawer
|
|
void _onNavigate(String route) {
|
|
Navigator.of(context).pop(); // Fermer le drawer
|
|
debugPrint('Navigation vers: $route');
|
|
// TODO: Implémenter la navigation
|
|
}
|
|
|
|
/// Callback pour la déconnexion
|
|
void _onLogout() {
|
|
Navigator.of(context).pop(); // Fermer le drawer
|
|
debugPrint('Déconnexion demandée');
|
|
// TODO: Implémenter la déconnexion
|
|
}
|
|
|
|
// === MÉTHODES UTILITAIRES ===
|
|
|
|
/// Actualise les données du dashboard
|
|
Future<void> _refreshData() async {
|
|
setState(() {
|
|
_isLoading = true;
|
|
});
|
|
|
|
// Simulation d'un appel API
|
|
await Future.delayed(const Duration(seconds: 1));
|
|
|
|
setState(() {
|
|
_isLoading = false;
|
|
});
|
|
|
|
if (mounted) {
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(
|
|
content: Text('Données actualisées'),
|
|
duration: Duration(seconds: 2),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// Affiche les notifications
|
|
void _showNotifications() {
|
|
debugPrint('Afficher les notifications');
|
|
// TODO: Implémenter l'affichage des notifications
|
|
}
|
|
|
|
/// Affiche les paramètres
|
|
void _showSettings() {
|
|
debugPrint('Afficher les paramètres');
|
|
// TODO: Implémenter l'affichage des paramètres
|
|
}
|
|
}
|