Appli Flutter se connecte bien à l'API.
This commit is contained in:
@@ -4,7 +4,7 @@ import '../../../../shared/theme/app_theme.dart';
|
||||
import '../../../../shared/widgets/coming_soon_page.dart';
|
||||
import '../../../../shared/widgets/buttons/buttons.dart';
|
||||
import '../../../dashboard/presentation/pages/enhanced_dashboard.dart';
|
||||
import '../../../members/presentation/pages/members_list_page.dart';
|
||||
import '../../../members/presentation/pages/membres_list_page.dart';
|
||||
import '../widgets/custom_bottom_nav_bar.dart';
|
||||
|
||||
class MainNavigation extends StatefulWidget {
|
||||
@@ -17,14 +17,12 @@ class MainNavigation extends StatefulWidget {
|
||||
class _MainNavigationState extends State<MainNavigation>
|
||||
with TickerProviderStateMixin {
|
||||
int _currentIndex = 0;
|
||||
late PageController _pageController;
|
||||
late AnimationController _fabAnimationController;
|
||||
late Animation<double> _fabAnimation;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_pageController = PageController();
|
||||
|
||||
_fabAnimationController = AnimationController(
|
||||
duration: const Duration(milliseconds: 300),
|
||||
@@ -44,7 +42,6 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_pageController.dispose();
|
||||
_fabAnimationController.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
@@ -85,9 +82,8 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: PageView(
|
||||
controller: _pageController,
|
||||
onPageChanged: _onPageChanged,
|
||||
body: IndexedStack(
|
||||
index: _currentIndex,
|
||||
children: [
|
||||
EnhancedDashboard(
|
||||
onNavigateToTab: _onTabTapped,
|
||||
@@ -151,33 +147,23 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
}
|
||||
}
|
||||
|
||||
void _onPageChanged(int index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
|
||||
// Animation du FAB
|
||||
if (index == 1 || index == 2 || index == 3) {
|
||||
_fabAnimationController.forward();
|
||||
} else {
|
||||
_fabAnimationController.reverse();
|
||||
}
|
||||
|
||||
// Vibration légère
|
||||
HapticFeedback.selectionClick();
|
||||
}
|
||||
|
||||
|
||||
void _onTabTapped(int index) {
|
||||
if (_currentIndex != index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
});
|
||||
|
||||
_pageController.animateToPage(
|
||||
index,
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
|
||||
// Animation du FAB
|
||||
if (index == 1 || index == 2 || index == 3) {
|
||||
_fabAnimationController.forward();
|
||||
} else {
|
||||
_fabAnimationController.reverse();
|
||||
}
|
||||
|
||||
// Vibration légère
|
||||
HapticFeedback.selectionClick();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,11 +205,11 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
}
|
||||
|
||||
Widget _buildMembresPage() {
|
||||
return MembersListPage();
|
||||
return const MembresListPage();
|
||||
}
|
||||
|
||||
Widget _buildCotisationsPage() {
|
||||
return ComingSoonPage(
|
||||
return const ComingSoonPage(
|
||||
title: 'Module Cotisations',
|
||||
description: 'Suivi et gestion des cotisations avec paiements automatiques',
|
||||
icon: Icons.payment_rounded,
|
||||
@@ -240,7 +226,7 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
}
|
||||
|
||||
Widget _buildEventsPage() {
|
||||
return ComingSoonPage(
|
||||
return const ComingSoonPage(
|
||||
title: 'Module Événements',
|
||||
description: 'Organisation et gestion d\'événements avec calendrier intégré',
|
||||
icon: Icons.event_rounded,
|
||||
@@ -257,51 +243,75 @@ class _MainNavigationState extends State<MainNavigation>
|
||||
}
|
||||
|
||||
Widget _buildMorePage() {
|
||||
return Scaffold(
|
||||
backgroundColor: AppTheme.backgroundLight,
|
||||
appBar: AppBar(
|
||||
title: const Text('Plus'),
|
||||
backgroundColor: AppTheme.infoColor,
|
||||
elevation: 0,
|
||||
automaticallyImplyLeading: false,
|
||||
actions: [
|
||||
IconButton(
|
||||
icon: const Icon(Icons.settings),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
body: ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
return Container(
|
||||
color: AppTheme.backgroundLight,
|
||||
child: Column(
|
||||
children: [
|
||||
_buildMoreSection(
|
||||
'Gestion',
|
||||
[
|
||||
_buildMoreItem(Icons.analytics, 'Rapports', 'Génération de rapports'),
|
||||
_buildMoreItem(Icons.account_balance, 'Finances', 'Tableau de bord financier'),
|
||||
_buildMoreItem(Icons.message, 'Communications', 'Messages et notifications'),
|
||||
_buildMoreItem(Icons.folder, 'Documents', 'Gestion documentaire'),
|
||||
],
|
||||
// Header personnalisé au lieu d'AppBar
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.fromLTRB(16, 50, 16, 16),
|
||||
decoration: const BoxDecoration(
|
||||
color: AppTheme.infoColor,
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(20),
|
||||
bottomRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Plus',
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
icon: const Icon(Icons.settings, color: Colors.white),
|
||||
onPressed: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildMoreSection(
|
||||
'Paramètres',
|
||||
[
|
||||
_buildMoreItem(Icons.person, 'Mon profil', 'Informations personnelles'),
|
||||
_buildMoreItem(Icons.notifications, 'Notifications', 'Préférences de notification'),
|
||||
_buildMoreItem(Icons.security, 'Sécurité', 'Mot de passe et sécurité'),
|
||||
_buildMoreItem(Icons.language, 'Langue', 'Changer la langue'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildMoreSection(
|
||||
'Support',
|
||||
[
|
||||
_buildMoreItem(Icons.help, 'Aide', 'Centre d\'aide et FAQ'),
|
||||
_buildMoreItem(Icons.contact_support, 'Contact', 'Nous contacter'),
|
||||
_buildMoreItem(Icons.info, 'À propos', 'Informations sur l\'application'),
|
||||
_buildMoreItem(Icons.logout, 'Déconnexion', 'Se déconnecter', isDestructive: true),
|
||||
],
|
||||
// Contenu scrollable
|
||||
Expanded(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(16),
|
||||
children: [
|
||||
_buildMoreSection(
|
||||
'Gestion',
|
||||
[
|
||||
_buildMoreItem(Icons.analytics, 'Rapports', 'Génération de rapports'),
|
||||
_buildMoreItem(Icons.account_balance, 'Finances', 'Tableau de bord financier'),
|
||||
_buildMoreItem(Icons.message, 'Communications', 'Messages et notifications'),
|
||||
_buildMoreItem(Icons.folder, 'Documents', 'Gestion documentaire'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildMoreSection(
|
||||
'Paramètres',
|
||||
[
|
||||
_buildMoreItem(Icons.person, 'Mon profil', 'Informations personnelles'),
|
||||
_buildMoreItem(Icons.notifications, 'Notifications', 'Préférences de notification'),
|
||||
_buildMoreItem(Icons.security, 'Sécurité', 'Mot de passe et sécurité'),
|
||||
_buildMoreItem(Icons.language, 'Langue', 'Changer la langue'),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 24),
|
||||
_buildMoreSection(
|
||||
'Support',
|
||||
[
|
||||
_buildMoreItem(Icons.help, 'Aide', 'Centre d\'aide et FAQ'),
|
||||
_buildMoreItem(Icons.contact_support, 'Contact', 'Nous contacter'),
|
||||
_buildMoreItem(Icons.info, 'À propos', 'Informations sur l\'application'),
|
||||
_buildMoreItem(Icons.logout, 'Déconnexion', 'Se déconnecter', isDestructive: true),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user