feat: Improve UI responsiveness with dynamic text and icon colors based on theme
This commit is contained in:
@@ -10,13 +10,13 @@ class ShowTripDetailsContent extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
// You can access the trip via widget.trip
|
||||
// Détecter le thème actuel
|
||||
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
|
||||
final textColor = isDarkMode ? Colors.white : Colors.black;
|
||||
final secondaryTextColor = isDarkMode ? Colors.white70 : Colors.grey[600];
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text(widget.trip.title),
|
||||
@@ -28,53 +28,85 @@ class _ShowTripDetailsContentState extends State<ShowTripDetailsContent> {
|
||||
children: [
|
||||
Text(
|
||||
widget.trip.title,
|
||||
style: TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
|
||||
style: TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: textColor,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(widget.trip.description),
|
||||
Text(
|
||||
widget.trip.description,
|
||||
style: TextStyle(color: textColor),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.location_on, size: 16, color: Colors.grey[600]),
|
||||
Icon(Icons.location_on, size: 16, color: secondaryTextColor),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
widget.trip.location,
|
||||
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
|
||||
style: TextStyle(fontSize: 14, color: secondaryTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.calendar_today, size: 16, color: Colors.grey[600]),
|
||||
Icon(Icons.calendar_today, size: 16, color: secondaryTextColor),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'${widget.trip.startDate.toLocal()} - ${widget.trip.endDate.toLocal()}',
|
||||
style: TextStyle(fontSize: 14, color: Colors.grey[600]),
|
||||
'${widget.trip.startDate.day}/${widget.trip.startDate.month}/${widget.trip.startDate.year} - ${widget.trip.endDate.day}/${widget.trip.endDate.month}/${widget.trip.endDate.year}',
|
||||
style: TextStyle(fontSize: 14, color: secondaryTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
children: [
|
||||
Icon(Icons.group, size: 16, color: Colors.grey[600]),
|
||||
Icon(Icons.group, size: 16, color: secondaryTextColor),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'${widget.trip.participants.length} participant${widget.trip.participants.length > 1 ? 's' : ''}',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey[600],
|
||||
color: secondaryTextColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text('Budget: ${widget.trip.budget ?? 'N/A'}€'),
|
||||
Text(
|
||||
'Budget: ${widget.trip.budget ?? 'N/A'}€',
|
||||
style: TextStyle(color: textColor),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
// Add more trip details as needed
|
||||
SizedBox(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: ElevatedButton(
|
||||
onPressed: () {
|
||||
// Handle button press
|
||||
},
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: Color.fromARGB(255, 0, 123, 255),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
),
|
||||
child: Text(
|
||||
'Modifier les informations du voyage',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user