import 'package:citycards_customer/common_packages/custom_text.dart';
import 'package:citycards_customer/itinerary_creation/bloc/itinerary_steps_selection_bloc.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class ShoppingRatingView extends StatelessWidget {
  ShoppingRatingView({super.key});

  final List<Map<String, String>> shoppingRatingOption = [
    {"icon": "assets/icons/tr_rate1.png", "option": "Not interested"},
    {"icon": "assets/icons/tr_rate2.png", "option": "Just for souvenirs"},
    {"icon": "assets/icons/tr_rate3.png", "option": "Love browsing!"},
    {"icon": "assets/icons/tr_rate4.png", "option": "Shopping is a must!"},
  ];


  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        CustomText(text: "🛒", size: 36.sp),
        SizedBox(height: 9.h),
        Text(
          "How do you feel about shopping during your trip?",
          style: TextStyle(
            color: Color(0xFF101828),
            fontSize: 24.sp,
            fontWeight: FontWeight.w500,
          ),
          textAlign: TextAlign.center,
        ),
        SizedBox(height: 30.h),
        ...List.generate(shoppingRatingOption.length, (index) {
          final item = shoppingRatingOption[index];
          return Padding(
            padding: EdgeInsets.only(bottom: 12.h),
            child: GestureDetector(
              onTap: () {
                context.read<ItineraryStepNavigationBloc>().add(
                  ItineraryStepNavigationNextEvent(),
                );
              },
              child: Container(
                padding: EdgeInsets.symmetric(horizontal: 24.w),
                height: 82.h,
                decoration: BoxDecoration(
                    color: Colors.white,
                    borderRadius: BorderRadius.circular(16.r),
                    border: Border.all(
                        color: Color(0xFFE5E7EB),
                        width: 1.1
                    ),
                    boxShadow: [
                      BoxShadow(
                        color: Colors.black12,
                        offset: Offset(1,2),
                        blurRadius: 1,
                      )
                    ]
                ),
                alignment: Alignment.center,
                child: Row(
                  children: [
                    Image.asset(item['icon']?? "", scale: 4,),
                    SizedBox(width: 16.w,),
                    CustomText(
                      text: item['option'] ?? "",
                      size: 16.sp,
                      color: const Color(0xFF101828),
                      weight: FontWeight.w500,
                    ),
                  ],
                ),
              ),
            ),
          );
        }),
      ],
    );
  }
}
