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

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

  @override
  Widget build(BuildContext context) {
    return Column(
      mainAxisAlignment:MainAxisAlignment.start,

      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        12.verticalSpace,
        Column(
          mainAxisAlignment:MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text('Pick it up for free', style: AppTextStyles.size24Bold),
            Text(
              "Skip the fees when you order pick-up",
              style: AppTextStyles.size14Regular.copyWith(
                color: AppColors.c545454,
              ),
            ),
            7.verticalSpace,
          ],
        ).paddingSymmetric(horizontal: 15),
        Container(
          height: 210,
          width: context.w,
          decoration: BoxDecoration(
            image: DecorationImage(
              image: AssetImage(AppImages.imgPickUp),
              fit: BoxFit.cover,
            ),
          ),
          child: Align(
            alignment: AlignmentGeometry.topCenter,
            child: CarouselSlider.builder(
              options: CarouselOptions(
                height: 100.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 PickItUpItem().paddingOnly(left: 15);
                  },
                );
              },
            ),
          ),
        ),
        10.verticalSpace,
        WFoodItem(),
        40.verticalSpace


      ],
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Material(
      color: AppColors.cTransparent,
      child: InkWell(
        onTap: () {},
        child: Ink(
          decoration: BoxDecoration(
            color: AppColors.cFFFFFF,
            boxShadow: [
              BoxShadow(
                color: AppColors.c000000.newWithOpacity(.25),
                offset: const Offset(0, 1),
                blurRadius: 2,
              ),
            ],
          ),
          child: Row(
            spacing: 6,
            children: [
              Image.network(
                AppLocaleKeys.imageUrl,
                height: 88,
                width: 96,
                fit: BoxFit.cover,
              ).paddingAll(4),
              Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Text("Island Takeway", style: AppTextStyles.size17Bold),
                  Text(
                    "10-20 min",
                    style: AppTextStyles.size14Medium.copyWith(
                      color: AppColors.c6B6B6B,
                    ),
                  ),
                ],
              ).paddingOnly(top: 4, bottom: 4, right: 40),
            ],
          ),
        ),
      ),
    );
  }
}
