feat: ajout de champs jauge et contact mail et télphone.

Changement des icons de l'app
This commit is contained in:
ElPoyo
2025-12-20 15:38:27 +01:00
parent 28d9e008af
commit df9e24d3b3
52 changed files with 353 additions and 222 deletions

View File

@@ -12,6 +12,8 @@ class EventDetailsDescription extends StatelessWidget {
@override
Widget build(BuildContext context) {
final bool isMobile = MediaQuery.of(context).size.width < 600;
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -24,10 +26,17 @@ class EventDetailsDescription extends StatelessWidget {
),
const SizedBox(height: 8),
SelectableText(
event.description,
event.description.isEmpty ? 'Aucune description' : event.description,
style: Theme.of(context).textTheme.bodyLarge,
),
const SizedBox(height: 16),
// Informations de contact et jauge
if (event.jauge != null || event.contactEmail != null || event.contactPhone != null) ...[
isMobile ? _buildContactInfoMobile(context) : _buildContactInfoDesktop(context),
const SizedBox(height: 16),
],
Text(
'Adresse',
style: Theme.of(context).textTheme.titleLarge?.copyWith(
@@ -50,5 +59,104 @@ class EventDetailsDescription extends StatelessWidget {
],
);
}
Widget _buildContactInfoMobile(BuildContext context) {
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (event.jauge != null) ...[
_buildInfoRow(context, Icons.people, 'Jauge', '${event.jauge} personnes'),
const SizedBox(height: 8),
],
if (event.contactEmail != null) ...[
_buildInfoRow(context, Icons.email, 'Email', event.contactEmail!),
const SizedBox(height: 8),
],
if (event.contactPhone != null) ...[
_buildInfoRow(context, Icons.phone, 'Téléphone', event.contactPhone!),
],
],
);
}
Widget _buildContactInfoDesktop(BuildContext context) {
return Wrap(
spacing: 24,
runSpacing: 12,
children: [
if (event.jauge != null)
_buildInfoChip(context, Icons.people, 'Jauge', '${event.jauge} personnes'),
if (event.contactEmail != null)
_buildInfoChip(context, Icons.email, 'Email', event.contactEmail!),
if (event.contactPhone != null)
_buildInfoChip(context, Icons.phone, 'Téléphone', event.contactPhone!),
],
);
}
Widget _buildInfoRow(BuildContext context, IconData icon, String label, String value) {
return Row(
children: [
Icon(icon, size: 20, color: Theme.of(context).primaryColor),
const SizedBox(width: 8),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
label,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Colors.grey[600],
),
),
SelectableText(
value,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
),
),
],
),
),
],
);
}
Widget _buildInfoChip(BuildContext context, IconData icon, String label, String value) {
final primaryColor = Theme.of(context).primaryColor;
return Container(
padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: primaryColor.withOpacity(0.1),
borderRadius: BorderRadius.circular(8),
border: Border.all(color: primaryColor.withOpacity(0.2)),
),
child: Row(
mainAxisSize: MainAxisSize.min,
children: [
Icon(icon, size: 18, color: primaryColor),
const SizedBox(width: 8),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.min,
children: [
Text(
label,
style: Theme.of(context).textTheme.labelSmall?.copyWith(
color: Colors.grey[600],
),
),
SelectableText(
value,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontWeight: FontWeight.w500,
),
),
],
),
],
),
);
}
}