feat: Add trip details screen and update navigation in home content

This commit is contained in:
Dayron
2025-10-08 23:36:10 +02:00
parent 4e403f3308
commit 56211e0b58
2 changed files with 86 additions and 32 deletions

View File

@@ -0,0 +1,80 @@
import 'package:flutter/material.dart';
import 'package:travel_mate/models/trip.dart';
class ShowTripDetailsContent extends StatefulWidget {
final Trip trip;
const ShowTripDetailsContent({super.key, required this.trip});
@override
State<ShowTripDetailsContent> createState() => _ShowTripDetailsContentState();
}
class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
@override
Widget build(BuildContext context) {
// You can access the trip via widget.trip
return Scaffold(
appBar: AppBar(
title: Text(widget.trip.title),
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
widget.trip.title,
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
SizedBox(height: 8),
Text(widget.trip.description),
SizedBox(height: 16),
Row(
children: [
Icon(Icons.location_on, size: 16, color: Colors.grey[600]),
SizedBox(width: 8),
Text(
widget.trip.location,
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
),
],
),
SizedBox(height: 8),
Row(
children: [
Icon(Icons.calendar_today, size: 16, color: Colors.grey[600]),
SizedBox(width: 8),
Text(
'${widget.trip.startDate.toLocal()} - ${widget.trip.endDate.toLocal()}',
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
),
],
),
SizedBox(height: 8),
Row(
children: [
Icon(Icons.group, size: 16, color: Colors.grey[600]),
SizedBox(width: 8),
Text(
'${widget.trip.participants.length} participant${widget.trip.participants.length > 1 ? 's' : ''}',
style: TextStyle(
fontSize: 14,
color: Colors.grey[600],
),
),
],
),
SizedBox(height: 16),
Text('Budget: ${widget.trip.budget ?? 'N/A'}'),
SizedBox(height: 16),
// Add more trip details as needed
],
),
)
);
}
}