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],
);
}
}

211
lib/pages/login.dart Normal file
View File

@@ -0,0 +1,211 @@
//import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
class LoginPage extends StatelessWidget {
const LoginPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: Column(
children: [
const SizedBox(height: 40),
const Text(
'Bienvenue sur Travel Mate',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 12),
const Text(
'Connectez-vous pour continuer',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
const SizedBox(height: 80),
const TextField(
decoration: InputDecoration(
labelText: 'Email',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
const TextField(
obscureText: true,
decoration: InputDecoration(
labelText: 'Password',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
// Logique de connexion
Navigator.pushReplacementNamed(context, '/home');
},
style: ElevatedButton.styleFrom(
minimumSize: const Size.fromHeight(50),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: const Text('Login', style: TextStyle(fontSize: 18)),
),
const SizedBox(height: 20),
TextButton(
onPressed: () {
Navigator.pushNamed(context, '/forgot');
},
child: const Text('Mot de passe oublié ?'),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("Pas encore inscrit ? "),
GestureDetector(
onTap: () {
// Logique d'inscription
Navigator.pushNamed(context, '/signup');
},
child: const Text(
'Inscrivez-vous !',
style: TextStyle(
color: Color.fromARGB(255, 37, 109, 167),
decoration: TextDecoration.underline,
),
),
),
],
),
const SizedBox(height: 40),
Container(
width: double.infinity,
height: 1,
color: Colors.grey.shade300,
),
const SizedBox(height: 40),
Text(
'Ou connectez-vous avec',
style: TextStyle(color: Colors.grey.shade600),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
// Bouton Google avec fond
GestureDetector(
onTap: () {
// Logique de connexion avec Google
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.black,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.3),
spreadRadius: 1,
blurRadius: 3,
offset: Offset(0, 1),
),
],
border: Border.all(
color: Colors.grey.shade300,
width: 1,
),
),
child: Center(
child: Image.asset(
'assets/icons/google.png',
width: 24,
height: 24,
),
),
),
),
const SizedBox(height: 8),
const Text('Google'),
],
),
const SizedBox(width: 40),
Column(
children: [
// APPLE
GestureDetector(
onTap: () {
// Logique de connexion avec Google
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.black,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.3),
spreadRadius: 1,
blurRadius: 3,
offset: Offset(0, 1),
),
],
border: Border.all(
color: Colors.grey.shade300,
width: 1,
),
),
child: Center(
child: Image.asset(
'assets/icons/apple_white.png',
width: 24,
height: 24,
),
),
),
),
const SizedBox(height: 8),
const Text('Apple'),
],
),
],
),
],
),
),
),
),
);
}
}

106
lib/pages/resetpswd.dart Normal file
View File

@@ -0,0 +1,106 @@
import 'package:flutter/material.dart';
class ForgotPasswordPage extends StatelessWidget {
const ForgotPasswordPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: Column(
children: [
const Text(
"Travel Mate",
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 24),
const Text(
"Vous avez oublié votre mot de passe ? \n Ne vous inquiétez pas vous pouvez le réinitaliser !",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
const SizedBox(height: 40),
const Text(
"Quel est votre email ? \n Si celui-ci existe dans note base de donées, nous vous enverrons un mail avec un mot de passe unique.",
textAlign: TextAlign.center,
style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),
),
const SizedBox(height: 24),
const TextField(
decoration: InputDecoration(
labelText: 'example@travelmate.com',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 40),
ElevatedButton(
onPressed: () {
// Logique de connexion
},
style: ElevatedButton.styleFrom(
minimumSize: const Size.fromHeight(50),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: const Text('Envoyer', style: TextStyle(fontSize: 18)),
),
const SizedBox(height: 20),
Container(
width: double.infinity,
height: 1,
color: Colors.grey.shade300,
),
const SizedBox(height: 24),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("Pas encore inscrit ? "),
GestureDetector(
onTap: () {
// Go to sign up page
Navigator.pushNamed(context, '/signup');
},
child: const Text(
'Inscrivez-vous !',
style: TextStyle(
color: Color.fromARGB(255, 37, 109, 167),
decoration: TextDecoration.underline,
),
),
),
],
),
],
),
),
),
),
);
}
}

246
lib/pages/signup.dart Normal file
View File

@@ -0,0 +1,246 @@
import 'package:flutter/material.dart';
class SignUpPage extends StatelessWidget {
const SignUpPage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.arrow_back),
onPressed: () {
Navigator.pop(context);
},
),
backgroundColor: Colors.transparent,
elevation: 0,
),
body: SafeArea(
child: Padding(
padding: const EdgeInsets.all(16.0),
child: Center(
child: Column(
children: [
const Text(
'Bienvenue sur Travel Mate',
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
const SizedBox(height: 12),
const Text(
'Créez un compte pour continuer',
style: TextStyle(fontSize: 16, color: Colors.grey),
),
const SizedBox(height: 20),
const TextField(
decoration: InputDecoration(
labelText: 'Nom',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 12),
const TextField(
decoration: InputDecoration(
labelText: 'Prénom',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
const TextField(
decoration: InputDecoration(
labelText: 'Email',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
const TextField(
obscureText: true,
decoration: InputDecoration(
labelText: 'Mot de passe',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
const TextField(
obscureText: true,
decoration: InputDecoration(
labelText: 'Confirmez le mot de passe',
border: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(12)),
),
),
),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
// Logique d'inscription
Navigator.pushNamed(context, '/home');
},
style: ElevatedButton.styleFrom(
minimumSize: const Size.fromHeight(50),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(12),
),
),
child: const Text(
'S\'inscrire',
style: TextStyle(fontSize: 18),
),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text("Déjà un compte ? "),
GestureDetector(
onTap: () {
// Logique de navigation vers la page de connexion
Navigator.pop(context);
},
child: const Text(
'Connectez-vous !',
style: TextStyle(
color: Colors.blue,
fontWeight: FontWeight.bold,
),
),
),
],
),
const SizedBox(height: 40),
Container(
width: double.infinity,
height: 1,
color: Colors.grey.shade300,
),
const SizedBox(height: 40),
Text(
'Ou inscrivez-vous avec',
style: TextStyle(color: Colors.grey.shade600),
),
const SizedBox(height: 20),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Column(
children: [
// Bouton Google avec fond
GestureDetector(
onTap: () {
// Logique de connexion avec Google
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.black,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.3),
spreadRadius: 1,
blurRadius: 3,
offset: Offset(0, 1),
),
],
border: Border.all(
color: Colors.grey.shade300,
width: 1,
),
),
child: Center(
child: Image.asset(
'assets/icons/google.png',
width: 24,
height: 24,
),
),
),
),
const SizedBox(height: 8),
const Text('Google'),
],
),
const SizedBox(width: 40),
Column(
children: [
// APPLE
GestureDetector(
onTap: () {
// Logique de connexion avec Google
},
child: Container(
width: 50,
height: 50,
decoration: BoxDecoration(
color: Colors.black,
shape: BoxShape.circle,
boxShadow: [
BoxShadow(
color: Colors.grey.withValues(alpha: 0.3),
spreadRadius: 1,
blurRadius: 3,
offset: Offset(0, 1),
),
],
border: Border.all(
color: Colors.grey.shade300,
width: 1,
),
),
child: Center(
child: Image.asset(
'assets/icons/apple_white.png',
width: 24,
height: 24,
),
),
),
),
const SizedBox(height: 8),
const Text('Apple'),
],
),
],
),
],
),
),
),
),
);
}
}