import 'package:flutter/material.dart'; class RideCard extends StatelessWidget { final String dateText; final String userName; final String userImage; final String status; final String currencyAmount; final IconData timeIcon; final String timeDetails; final IconData paymentIcon; final String paymentMethod; final List locations; RideCard({ required this.dateText, required this.userName, required this.userImage, required this.status, required this.currencyAmount, required this.timeIcon, required this.timeDetails, required this.paymentIcon, required this.paymentMethod, required this.locations, }); @override Widget build(BuildContext context) { return Card( color: Colors.white, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(15), ), elevation: 4, shadowColor: Colors.black.withOpacity(0.15), child: Padding( padding: const EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ // Row for Date, Status, Currency, and User Info Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( dateText, style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold, fontFamily: 'Poppins', color: Colors.black, ), ), SizedBox(height: 5), Row( children: [ CircleAvatar( radius: 14, backgroundImage: AssetImage(userImage), ), SizedBox(width: 8), Text( userName, style: const TextStyle( fontSize: 14, fontFamily: 'Poppins', color: Colors.black, ), ), ], ), ], ), Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ Row( children: [ Container( padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( color: Colors.yellow, borderRadius: BorderRadius.circular(8), ), child: Text( status, style: TextStyle( fontSize: 12, fontFamily: 'Poppins', fontWeight: FontWeight.bold, color: Colors.black, ), ), ), SizedBox(width: 8), Image.asset( 'assets/icons/tnd_icon.png', height: 20, ), SizedBox(width: 4), Text( currencyAmount, style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold, fontFamily: 'Poppins', ), ), ], ), ], ), ], ), SizedBox(height: 10), // Row for Ride Time, Payment Method, Distance Row( children: [ Icon(timeIcon, color: Colors.orange, size: 20), SizedBox(width: 5), Text( timeDetails, style: const TextStyle( fontSize: 14, fontFamily: 'Poppins', color: Colors.black, ), ), Spacer(), Icon(paymentIcon, color: Colors.purple, size: 20), SizedBox(width: 5), Text( paymentMethod, style: const TextStyle( fontSize: 14, fontFamily: 'Poppins', color: Colors.black, ), ), ], ), SizedBox(height: 10), // List of Locations ...locations.map((location) => Padding( padding: const EdgeInsets.only(bottom: 6.0), child: Row( children: [ const Icon(Icons.location_pin, color: Colors.green, size: 20), const SizedBox(width: 5), Expanded( child: Text( location, style: const TextStyle( fontSize: 14, fontFamily: 'Poppins', color: Colors.black, ), ), ), const Icon( Icons.check_circle, color: Colors.green, size: 18, ), // You can replace this with a dynamic value if needed ], ), )), SizedBox(height: 16), // Row of Action Buttons Row( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ IconButton( onPressed: () {}, icon: Icon(Icons.phone, color: Colors.green), iconSize: 28, ), IconButton( onPressed: () {}, icon: Icon(Icons.receipt_long, color: Colors.blue), iconSize: 28, ), ElevatedButton( onPressed: () {}, style: ElevatedButton.styleFrom( backgroundColor: Color(0xFF5B259F), padding: EdgeInsets.symmetric(vertical: 12, horizontal: 20), shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(10), ), ), child: const Text( 'Consulter', style: TextStyle( fontSize: 14, fontFamily: 'Poppins', color: Colors.white, ), ), ), ], ), ], ), ), ); } }