import 'package:food_delivery_client/feature/home/presentation/mixins/categories_mixin.dart';

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

class CategoriesPage extends StatelessWidget with CategoriesMixin {
  CategoriesPage({super.key});

  show(BuildContext context) {
    showModalBottomSheet(
      context: context,
      isScrollControlled: true,

      builder: (context) => Wrap(children: [this]),
    );
  }

  @override
  Widget build(BuildContext context) {
    List<String> _titles = [
      context.loc.convenience,
      context.loc.alcohol,
      context.loc.petSupplies,
      context.loc.flowers,
      context.loc.grocery,
      context.loc.american,
      context.loc.speciality,
      context.loc.takeout,
      context.loc.asian,
      context.loc.iceCream,
      context.loc.halal,
      context.loc.retails,
      context.loc.caribbean,
      context.loc.indian,
      context.loc.french,
      context.loc.fastFoods,
      context.loc.burger,
      context.loc.ride,
      context.loc.chinese,
      context.loc.dessert,
    ];
    return Material(
      color: AppColors.cFFFFFF,
      borderRadius: AppUtils.kBorderRadius20,
      child: SafeArea(
        child: Column(
          children: [
            24.verticalSpace,
            Text(context.loc.allCategories, style: AppTextStyles.size20Regular),
            30.verticalSpace,
            GridView.builder(
              itemCount: images.length,
              padding: EdgeInsets.zero,
              shrinkWrap: true,
              physics: const NeverScrollableScrollPhysics(),
              gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
                crossAxisCount: 4,
                crossAxisSpacing: 5,
                mainAxisSpacing: 10,
                childAspectRatio: 78 / 100,
              ),
              itemBuilder: (context, index) => WCategoryItem(
                onTap: () {
                  context.push(
                    Routes.restaurantsByCategory,
                    extra: _titles[index],
                  );
                },
                imgUrl: images[index],
                text: _titles[index],
              ),
            ),
            40.verticalSpace,
          ],
        ).paddingSymmetric(horizontal: 15),
      ),
    );
  }
}
