import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../models/location_point.dart'; class LocationInfoCard extends StatelessWidget { final List locations; LocationInfoCard({required this.locations}); @override Widget build(BuildContext context) { return Center( child: Container( width: MediaQuery.of(context).size.width * 0.8, padding: const EdgeInsets.symmetric(vertical: 16, horizontal: 20), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(16), boxShadow: [ BoxShadow( color: Colors.black.withOpacity(0.1), blurRadius: 8, spreadRadius: 2, offset: Offset(0, 4), ), ], ), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: List.generate( locations.length, (index) => Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ _buildLocationRow( icon: locations[index].icon, iconColor: locations[index].iconColor, title: locations[index].title, subtitle: locations[index].subtitle, ), if (index != locations.length - 1) _buildDashedLine(), ], ), ), ), ), ); } Widget _buildLocationRow({ required IconData icon, required Color iconColor, required String title, required String subtitle, }) { return Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ Column( children: [ Icon(icon, color: iconColor, size: 16), ], ), const SizedBox(width: 12), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( subtitle, overflow: TextOverflow.ellipsis, maxLines: 1, style: GoogleFonts.poppins( fontSize: 12, color: Colors.grey.shade600), ), Text( title, overflow: TextOverflow.ellipsis, maxLines: 1, style: GoogleFonts.poppins( fontSize: 14, fontWeight: FontWeight.bold), ), ], ), ), ], ); } Widget _buildDashedLine() { return Padding( padding: EdgeInsets.only(left: 7, top: 2, bottom: 2), child: Column( children: List.generate( 6, (index) => Container( width: 2, height: 6, margin: EdgeInsets.symmetric(vertical: 1), color: Colors.grey.shade400, ), ), ), ); } }