feat: Add trip details screen and update navigation in home content
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:travel_mate/components/home/create_trip_content.dart';
|
||||
import '../../providers/user_provider.dart';
|
||||
import '../../services/trip_service.dart';
|
||||
import '../../models/trip.dart';
|
||||
import '../home/show_trip_details_content.dart';
|
||||
|
||||
class HomeContent extends StatefulWidget {
|
||||
const HomeContent({super.key});
|
||||
@@ -187,7 +188,10 @@ class _HomeContentState extends State<HomeContent> {
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
_showTravelDetails(context, trip);
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(builder: (context) => ShowTripDetailsContent(trip: trip)),
|
||||
);
|
||||
},
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
child: Column(
|
||||
@@ -309,7 +313,7 @@ class _HomeContentState extends State<HomeContent> {
|
||||
Icon(Icons.group, size: 16, color: Colors.grey[600]),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'${trip.participants.length} participant${trip.participants.length > 0 ? 's' : ''}',
|
||||
'${trip.participants.length} participant${trip.participants.length > 1 ? 's' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey[600],
|
||||
@@ -391,34 +395,4 @@ class _HomeContentState extends State<HomeContent> {
|
||||
return 'À venir';
|
||||
}
|
||||
}
|
||||
|
||||
void _showTravelDetails(BuildContext context, Trip trip) {
|
||||
Navigator.push(
|
||||
context,
|
||||
MaterialPageRoute(
|
||||
builder: (context) => Scaffold(
|
||||
appBar: AppBar(title: Text(trip.title)),
|
||||
body: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text('Destination: ${trip.location}'),
|
||||
SizedBox(height: 8),
|
||||
Text('Description: ${trip.description}'),
|
||||
SizedBox(height: 8),
|
||||
Text('Dates: ${trip.startDate.day}/${trip.startDate.month}/${trip.startDate.year} - ${trip.endDate.day}/${trip.endDate.month}/${trip.endDate.year}'),
|
||||
SizedBox(height: 8),
|
||||
Text('Budget: ${trip.budget}€'),
|
||||
SizedBox(height: 8),
|
||||
Text('Participants: ${trip.participants.length}'),
|
||||
SizedBox(height: 16),
|
||||
Text('(Détails complets à implémenter)'),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user