import 'package:flutter/material.dart'; import 'custom_text.dart'; class RideDetailColumn extends StatelessWidget { final IconData icon; final String value; final String label; final Color color; final Color colordescription; const RideDetailColumn({ required this.icon, required this.value, required this.label, required this.color, required this.colordescription, }); @override Widget build(BuildContext context) { return Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ Icon(icon, color: color, size: 20), const SizedBox(height: 4), Text( value, style: TextStyle( fontSize: 13, fontFamily: 'Poppins', fontWeight: FontWeight.bold, color: color), ), Text( label, style: TextStyle(fontSize: 13, fontFamily: 'Poppins',color: colordescription), ), ], ); } } class RideLocationRow extends StatelessWidget { final IconData icon; final Color color; final String title; final String label; final bool isBold; final bool isStartdots; final bool isEnddots; final Color colordescription; const RideLocationRow({ required this.icon, required this.color, required this.isStartdots, required this.isEnddots, required this.title, required this.label, required this.colordescription, this.isBold = false, // Added this parameter to control text weight }); @override Widget build(BuildContext context) { return Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( children: [ Padding( padding: const EdgeInsets.only(top: 8.0), // Add padding here as needed child: Icon(icon, color: color, size: 16), // Adjust padding value to match your needs ), // Make the icon smaller to better match the provided screenshot if (isStartdots) Padding( padding: const EdgeInsets.only(top: 4.0, bottom: 0.0), // Padding between icon and dotted line child: CustomPaint( painter: DottedLinePainter(), size: const Size(1, 30), // Adjust size to make the dotted line reach the next row ), ), ], ), const SizedBox(width: 8.0), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Txt( text: label, overflow: TextOverflow.ellipsis, maxLines: 1, style: TextStyle(fontSize: 12,fontFamily: 'Poppins',color: colordescription), ), Txt( text: title, maxLines: 2, overflow: TextOverflow.ellipsis, style: TextStyle( fontSize: 16, fontFamily: 'Poppins', fontWeight: isBold ? FontWeight.bold : FontWeight.normal, // Use bold only where needed ), ), ], ), ), ], ); } } class DottedLinePainter extends CustomPainter { @override void paint(Canvas canvas, Size size) { Paint paint = Paint() ..color = Colors.grey // Change color to match your design ..strokeWidth = 2 ..style = PaintingStyle.stroke; double dashHeight = 4, dashSpace = 4, startY = 0; while (startY < size.height) { canvas.drawLine(Offset(0, startY), Offset(0, startY + dashHeight), paint); startY += dashHeight + dashSpace; } } @override bool shouldRepaint(covariant CustomPainter oldDelegate) { return false; } }