import '../../../../../../food_delivery_client.dart';

class WPopularNearYou extends StatelessWidget {
  const WPopularNearYou({super.key});

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        10.verticalSpace,
        WSeeAllRaw(title: "Popular near you", onPressed: () {}),
        10.verticalSpace,
        CarouselSlider.builder(
          options: CarouselOptions(
            height: 180.0,
            reverse: false,
            viewportFraction: 0.9,
            animateToClosest: true,
            autoPlay: true,
            autoPlayCurve: Curves.easeIn,
            initialPage: 0,
            padEnds: false,
            enableInfiniteScroll: true,
            scrollPhysics: const AlwaysScrollableScrollPhysics(),
            scrollDirection: Axis.horizontal,
          ),
          itemCount: 5,
          itemBuilder: (context, index, realIndex) {
            return Builder(
              builder: (BuildContext context) {
                return WFoodItem(
                  imageHeight: 130,
                  textStyle1: AppTextStyles.size14Medium,
                  textStyle2: AppTextStyles.size12Regular,
                );
              },
            );
          },
        ),
        13.verticalSpace,
        WDivider(),
        10.verticalSpace,
        ListView.separated(
          shrinkWrap: true,
          physics: const NeverScrollableScrollPhysics(),
          keyboardDismissBehavior: ScrollViewKeyboardDismissBehavior.onDrag,
          scrollDirection: Axis.vertical,
          itemBuilder: (context, index) => WFoodItem(),
          separatorBuilder: (context, index) => 25.verticalSpace,
          itemCount: 5,
        ),
        25.verticalSpace,
        WDivider(),
      ],
    );
  }
}
