395 lines
12 KiB
Dart
395 lines
12 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ProfileScreen extends StatelessWidget {
|
|
const ProfileScreen({super.key});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
appBar: AppBar(
|
|
title: const Text('Profil',
|
|
style: TextStyle(
|
|
color: Color(0xFF1DBF73), // Définit la couleur verte du texte
|
|
),
|
|
),
|
|
backgroundColor: const Color(0xFF1E1E2C),
|
|
actions: [
|
|
IconButton(
|
|
icon: const Icon(Icons.settings, color: Colors.white),
|
|
onPressed: () {
|
|
// Naviguer vers la page des paramètres
|
|
},
|
|
),
|
|
],
|
|
),
|
|
body: ListView(
|
|
padding: const EdgeInsets.all(16.0),
|
|
children: [
|
|
_buildUserInfoCard(),
|
|
const SizedBox(height: 20),
|
|
_buildEditOptionsCard(),
|
|
const SizedBox(height: 20),
|
|
_buildStatisticsSectionCard(),
|
|
const SizedBox(height: 20),
|
|
_buildExpandableSectionCard(
|
|
title: 'Historique',
|
|
icon: Icons.history,
|
|
children: [
|
|
_buildAnimatedListTile(
|
|
icon: Icons.event_note,
|
|
label: 'Historique des Événements',
|
|
onTap: () {
|
|
// Naviguer vers l'historique des événements
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.history,
|
|
label: 'Historique des Publications',
|
|
onTap: () {
|
|
// Naviguer vers l'historique des publications
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.bookmark,
|
|
label: 'Historique de Réservations',
|
|
onTap: () {
|
|
// Naviguer vers l'historique des réservations
|
|
},
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 20),
|
|
_buildExpandableSectionCard(
|
|
title: 'Préférences et Paramètres',
|
|
icon: Icons.settings,
|
|
children: [
|
|
_buildAnimatedListTile(
|
|
icon: Icons.privacy_tip,
|
|
label: 'Paramètres de confidentialité',
|
|
onTap: () {
|
|
// Naviguer vers les paramètres de confidentialité
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.notifications,
|
|
label: 'Notifications',
|
|
onTap: () {
|
|
// Naviguer vers les paramètres de notification
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.language,
|
|
label: 'Langue de l\'application',
|
|
onTap: () {
|
|
// Naviguer vers les paramètres de langue
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.format_paint,
|
|
label: 'Thème de l\'application',
|
|
onTap: () {
|
|
// Naviguer vers les paramètres de thème
|
|
},
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 20),
|
|
_buildSupportSectionCard(),
|
|
const SizedBox(height: 20),
|
|
_buildAccountDeletionCard(context),
|
|
],
|
|
),
|
|
backgroundColor: const Color(0xFF1E1E2C),
|
|
);
|
|
}
|
|
|
|
Widget _buildUserInfoCard() {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
children: [
|
|
const CircleAvatar(
|
|
radius: 50,
|
|
backgroundImage: AssetImage('lib/assets/images/profile_picture.png'),
|
|
backgroundColor: Colors.transparent,
|
|
),
|
|
const SizedBox(height: 10),
|
|
const Text(
|
|
'GBANE Dahoud',
|
|
style: TextStyle(
|
|
fontSize: 24,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
letterSpacing: 1.2,
|
|
),
|
|
),
|
|
const SizedBox(height: 5),
|
|
Text(
|
|
'pseudo',
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.grey[400],
|
|
fontStyle: FontStyle.italic,
|
|
),
|
|
),
|
|
const SizedBox(height: 5),
|
|
Text(
|
|
'gbanedahoud@lions.dev',
|
|
style: TextStyle(
|
|
fontSize: 14,
|
|
color: Colors.grey[600],
|
|
decoration: TextDecoration.underline,
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildEditOptionsCard() {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: Column(
|
|
children: [
|
|
_buildAnimatedListTile(
|
|
icon: Icons.edit,
|
|
label: 'Éditer le profil',
|
|
onTap: () {
|
|
// Naviguer vers la page d'édition de profil
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.camera_alt,
|
|
label: 'Changer la photo de profil',
|
|
onTap: () {
|
|
// Naviguer vers la page de changement de photo de profil
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.lock,
|
|
label: 'Changer le mot de passe',
|
|
onTap: () {
|
|
// Naviguer vers la page de changement de mot de passe
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildStatisticsSectionCard() {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16.0),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
const Text(
|
|
'Statistiques Personnelles',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
const SizedBox(height: 10),
|
|
_buildStatTile(
|
|
icon: Icons.event,
|
|
label: 'Événements Participés',
|
|
value: '12',
|
|
),
|
|
_buildStatTile(
|
|
icon: Icons.place,
|
|
label: 'Établissements Visités',
|
|
value: '8',
|
|
),
|
|
_buildStatTile(
|
|
icon: Icons.post_add,
|
|
label: 'Publications',
|
|
value: '24',
|
|
),
|
|
_buildStatTile(
|
|
icon: Icons.group,
|
|
label: 'Amis/Followers',
|
|
value: '150',
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildExpandableSectionCard({
|
|
required String title,
|
|
required IconData icon,
|
|
required List<Widget> children,
|
|
}) {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: ExpansionTile(
|
|
title: Text(
|
|
title,
|
|
style: const TextStyle(
|
|
fontSize: 18,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
leading: Icon(icon, color: const Color(0xFF1DBF73)),
|
|
iconColor: const Color(0xFF1DBF73),
|
|
collapsedIconColor: const Color(0xFF1DBF73),
|
|
children: children,
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildSupportSectionCard() {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: Column(
|
|
children: [
|
|
const Padding(
|
|
padding: EdgeInsets.all(16.0),
|
|
child: Text(
|
|
'Support et Assistance',
|
|
style: TextStyle(
|
|
fontSize: 20,
|
|
fontWeight: FontWeight.bold,
|
|
color: Colors.white,
|
|
),
|
|
),
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.help,
|
|
label: 'Support et Assistance',
|
|
onTap: () {
|
|
// Naviguer vers la page de support
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.article,
|
|
label: 'Conditions d\'utilisation',
|
|
onTap: () {
|
|
// Naviguer vers les conditions d'utilisation
|
|
},
|
|
),
|
|
_buildAnimatedListTile(
|
|
icon: Icons.privacy_tip,
|
|
label: 'Politique de confidentialité',
|
|
onTap: () {
|
|
// Naviguer vers la politique de confidentialité
|
|
},
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildAccountDeletionCard(BuildContext context) {
|
|
return Card(
|
|
color: const Color(0xFF292B37),
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
child: ListTile(
|
|
leading: const Icon(Icons.delete, color: Colors.redAccent),
|
|
title: const Text(
|
|
'Supprimer le compte',
|
|
style: TextStyle(color: Colors.redAccent, fontWeight: FontWeight.bold),
|
|
),
|
|
onTap: () {
|
|
_showDeleteConfirmationDialog(context);
|
|
},
|
|
hoverColor: Colors.red.withOpacity(0.1),
|
|
),
|
|
);
|
|
}
|
|
|
|
void _showDeleteConfirmationDialog(BuildContext context) {
|
|
showDialog(
|
|
context: context,
|
|
builder: (BuildContext context) {
|
|
return AlertDialog(
|
|
backgroundColor: const Color(0xFF1E1E2C),
|
|
title: const Text(
|
|
'Confirmer la suppression',
|
|
style: TextStyle(color: Colors.white),
|
|
),
|
|
content: const Text(
|
|
'Êtes-vous sûr de vouloir supprimer votre compte ? Cette action est irréversible.',
|
|
style: TextStyle(color: Colors.white70),
|
|
),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () {
|
|
Navigator.of(context).pop(); // Fermer le popup
|
|
},
|
|
child: const Text(
|
|
'Annuler',
|
|
style: TextStyle(color: Color(0xFF1DBF73)),
|
|
),
|
|
),
|
|
TextButton(
|
|
onPressed: () {
|
|
// Logique de suppression du compte ici
|
|
Navigator.of(context).pop(); // Fermer le popup après la suppression
|
|
},
|
|
child: const Text(
|
|
'Supprimer',
|
|
style: TextStyle(color: Colors.redAccent),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
Widget _buildAnimatedListTile({
|
|
required IconData icon,
|
|
required String label,
|
|
required VoidCallback onTap,
|
|
}) {
|
|
return InkWell(
|
|
onTap: onTap,
|
|
borderRadius: BorderRadius.circular(10),
|
|
splashColor: Colors.blueAccent.withOpacity(0.2),
|
|
child: ListTile(
|
|
leading: Icon(icon, color: const Color(0xFF1DBF73)),
|
|
title: Text(
|
|
label,
|
|
style: const TextStyle(color: Colors.white, fontWeight: FontWeight.w600),
|
|
),
|
|
hoverColor: Colors.blue.withOpacity(0.1),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildStatTile({
|
|
required IconData icon,
|
|
required String label,
|
|
required String value,
|
|
}) {
|
|
return ListTile(
|
|
leading: Icon(icon, color: const Color(0xFF1DBF73)),
|
|
title: Text(label, style: const TextStyle(color: Colors.white)),
|
|
trailing: Text(
|
|
value,
|
|
style: const TextStyle(
|
|
color: Colors.white,
|
|
fontWeight: FontWeight.bold,
|
|
fontSize: 16,
|
|
),
|
|
),
|
|
hoverColor: Colors.blue.withOpacity(0.1),
|
|
);
|
|
}
|
|
}
|