part of 'deliveries.dart';

// -------------------------------------------------------------------------
// MAP VIEW BUTTON (Customer locations)
// -------------------------------------------------------------------------
class MapViewRow extends StatelessWidget {
  final List<Map<String, dynamic>> deliveries;
  final Map<String, int>? preservedStepNumbers;

  const MapViewRow({
    super.key,
    required this.deliveries,
    this.preservedStepNumbers,
  });

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: () {
        Navigator.push(
          context,
          MaterialPageRoute(
            builder: (context) => MultiCustomerMapScreen(
              deliveries: deliveries,
              preservedStepNumbers: preservedStepNumbers ?? {},
            ),
          ),
        );
      },
      child: Image.asset(
        'assets/images/customermap.png',
        color: ColorConstants.primaryColor,
        height: 32,
        width: 32,
        errorBuilder: (c, e, s) =>
            const Icon(Icons.map, size: 32, color: Colors.blue),
      ),
    );
  }
}

