import 'package:flutter/material.dart'; class RideRequestCard extends StatelessWidget { final String clientWaitTitle; final String currencyAmount; final IconData? timeIcon; final String? timeText; final IconData? paymentIcon; final String? paymentMethod; final IconData? carIcon; final String? carDetails; final List locations; RideRequestCard({ required this.clientWaitTitle, required this.currencyAmount, this.timeIcon, this.timeText, this.paymentIcon, this.paymentMethod, this.carIcon, this.carDetails, required this.locations, }); @override Widget build(BuildContext context) { return Card( color: Colors.white, // Set background color to white shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(20), ), elevation: 6, // Added elevation to create a shadow effect shadowColor: Colors.black.withOpacity(0.25), // Adjusted the shadow color child: Padding( padding: const EdgeInsets.all(16.0), // Adjusted to make it more compact child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( clientWaitTitle, style: const TextStyle( fontSize: 14, // Reduced font size fontWeight: FontWeight.bold, fontFamily: 'Poppins', // Apply Poppins font ), ), Row( children: [ Image.asset( 'assets/icons/tnd_icon.png', height: 18, // Adjusted image size ), SizedBox(width: 5), Text( currencyAmount, style: const TextStyle( fontSize: 14, // Reduced font size fontWeight: FontWeight.bold, fontFamily: 'Poppins', // Apply Poppins font ), ), ], ), ], ), SizedBox(height: 6), // Adjusted spacing for compact design if (timeIcon != null && timeText != null) Row( children: [ Icon(timeIcon, color: Colors.orange, size: 20), // Reduced icon size SizedBox(width: 5), Text( timeText!, style: const TextStyle( fontSize: 14, // Reduced font size fontFamily: 'Poppins', // Apply Poppins font ), ), ], ), SizedBox(height: 6), if (paymentIcon != null && paymentMethod != null) Row( children: [ Icon(paymentIcon, color: Colors.purple, size: 20), // Reduced icon size SizedBox(width: 5), Text( paymentMethod!, style: const TextStyle( fontSize: 14, // Reduced font size fontFamily: 'Poppins', // Apply Poppins font ), ), Spacer(), if (carIcon != null && carDetails != null) Row( children: [ Icon(carIcon, color: Colors.red, size: 20), // Reduced icon size SizedBox(width: 5), Text( carDetails!, style: const TextStyle( fontSize: 14, // Reduced font size fontFamily: 'Poppins', // Apply Poppins font ), ), ], ), ], ), SizedBox(height: 12), ...locations.map((location) => Padding( padding: const EdgeInsets.only(bottom: 4.0), child: Row( children: [ Icon(Icons.location_pin, color: Colors.green, size: 20), // Reduced icon size SizedBox(width: 5), Expanded( child: Text( location, overflow: TextOverflow.ellipsis, style: const TextStyle( fontSize: 14, // Reduced font size fontFamily: 'Poppins', // Apply Poppins font ), ), ), ], ), )), SizedBox(height: 16), // Adjusted spacing Center( child: ElevatedButton( onPressed: () {}, style: ElevatedButton.styleFrom( backgroundColor: Color(0xFF5B259F), // Purple button color padding: EdgeInsets.symmetric(vertical: 12, horizontal: 40), // Further reduced padding for button width shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(25), ), ), child: const Text( 'Confirmer', style: TextStyle( fontSize: 16, // Reduced font size color: Colors.white, fontFamily: 'Poppins', // Apply Poppins font ), ), ), ), ], ), ), ); } }