First commit

This commit is contained in:
Van Leemput Dayron
2025-09-30 15:53:48 +02:00
commit 807b66f919
145 changed files with 6206 additions and 0 deletions

99
lib/pages/home.dart Normal file
View File

@@ -0,0 +1,99 @@
import 'package:flutter/material.dart';
import '../components/home/home_content.dart';
import '../components/settings/settings_content.dart';
import '../components/profile/profile_content.dart';
class HomePage extends StatefulWidget {
const HomePage({super.key});
@override
State<HomePage> createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
int _currentIndex = 0;
// Liste des composants à afficher
final List<Widget> _pages = [
HomeContent(),
SettingsContent(),
ProfileContent(),
];
// Titres correspondants
final List<String> _titles = ['Accueil', 'Paramètres', 'Profil'];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(_titles[_currentIndex]),
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
foregroundColor: Colors.white,
),
drawer: Drawer(
child: ListView(
padding: EdgeInsets.zero,
children: [
DrawerHeader(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.inversePrimary,
),
child: Text(
"Travel Mate",
style: TextStyle(color: Colors.white, fontSize: 24),
),
),
ListTile(
leading: Icon(Icons.home),
title: Text("Accueil"),
selected: _currentIndex == 0,
onTap: () {
setState(() {
_currentIndex = 0;
});
Navigator.pop(context);
},
),
ListTile(
leading: Icon(Icons.settings),
title: Text("Paramètres"),
selected: _currentIndex == 1,
onTap: () {
setState(() {
_currentIndex = 1;
});
Navigator.pop(context);
},
),
ListTile(
leading: Icon(Icons.person),
title: Text("Profil"),
selected: _currentIndex == 2,
onTap: () {
setState(() {
_currentIndex = 2;
});
Navigator.pop(context);
},
),
Divider(),
ListTile(
leading: Icon(Icons.logout, color: Colors.red),
title: Text("Déconnexion", style: TextStyle(color: Colors.red)),
onTap: () {
Navigator.pop(context);
Navigator.pushNamedAndRemoveUntil(
context,
'/login',
(route) => false,
);
},
),
],
),
),
body: _pages[_currentIndex],
);
}
}