Enhance trip details view with map options and improved layout

This commit is contained in:
Dayron
2025-11-03 15:26:52 +01:00
parent e3dad39c4f
commit cb253831a0
2 changed files with 628 additions and 319 deletions

View File

@@ -165,105 +165,76 @@ class _TripCardState extends State<TripCard> {
width: double.infinity,
child: _buildImageWidget(),
),
), // Informations du voyage
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.trip.title,
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold,
color: textColor,
),
// Informations du voyage
Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Titre du voyage
Text(
widget.trip.title,
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.bold,
color: textColor,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 4),
Row(
children: [
Icon(Icons.location_on, size: 16, color: secondaryTextColor),
const SizedBox(width: 4),
Expanded(
child: Text(
widget.trip.location,
style: TextStyle(color: secondaryTextColor),
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
),
],
),
const SizedBox(height: 8),
Text(
widget.trip.description,
style: TextStyle(color: secondaryTextColor, fontSize: 12),
maxLines: 2,
overflow: TextOverflow.ellipsis,
),
const SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Dates',
style: TextStyle(
color: secondaryTextColor,
fontSize: 10,
fontWeight: FontWeight.w500,
),
),
Text(
widget.trip.formattedDates,
style: TextStyle(color: textColor, fontSize: 12),
),
],
),
Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
'Participants',
style: TextStyle(
color: secondaryTextColor,
fontSize: 10,
fontWeight: FontWeight.w500,
),
),
Text(
'${widget.trip.totalParticipants - 1} personne${widget.trip.totalParticipants > 1 ? 's' : ''}',
style: TextStyle(color: textColor, fontSize: 12),
),
],
),
],
),
if (widget.trip.budget != null && widget.trip.budget! > 0) ...[
const SizedBox(height: 8),
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.green.withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(6),
),
child: Text(
'Budget: ${widget.trip.budget!.toStringAsFixed(0)}',
style: TextStyle(
color: Colors.green[700],
fontSize: 11,
fontWeight: FontWeight.w500,
// Dates, participants et bouton voir
Row(
children: [
// Colonne avec dates et participants
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
// Dates
Text(
widget.trip.formattedDates,
style: TextStyle(
color: secondaryTextColor,
fontSize: 14,
),
),
const SizedBox(height: 4),
// Participants
Text(
'${widget.trip.totalParticipants - 1} participant${widget.trip.totalParticipants > 1 ? 's' : ''}',
style: TextStyle(
color: secondaryTextColor,
fontSize: 14,
),
),
],
),
),
),
// Bouton Voir
ElevatedButton(
onPressed: widget.onTap,
style: ElevatedButton.styleFrom(
backgroundColor: Colors.blue,
foregroundColor: Colors.white,
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
),
child: const Text(
'Voir',
style: TextStyle(fontSize: 14),
),
),
],
),
],
],
),
),
),
],
),
),