feat:restaurants by category page done
This commit is contained in:
@@ -19,4 +19,7 @@ export 'package:food_delivery_client/feature/home/presentation/pages/filters_pag
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/filters_page/widgets/w_delivery_duration.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/filters_page/widgets/w_filter_dietary.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/filters_page/widgets/w_filters_deals.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/filters_page/widgets/w_filters_sort.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/filters_page/widgets/w_filters_sort.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/restaurants_by_category_page/widgets/w_restaurants_by_category_body.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/restaurants_by_category_page/widgets/w_featured_stores.dart';
|
||||
export 'package:food_delivery_client/feature/home/presentation/pages/restaurants_by_category_page/widgets/w_stores_list.dart';
|
||||
|
||||
@@ -59,7 +59,12 @@ class CategoriesPage extends StatelessWidget with CategoriesMixin {
|
||||
childAspectRatio: 78 / 100,
|
||||
),
|
||||
itemBuilder: (context, index) => WCategoryItem(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
context.push(
|
||||
Routes.restaurantsByCategory,
|
||||
extra: _titles[index],
|
||||
);
|
||||
},
|
||||
imgUrl: images[index],
|
||||
text: _titles[index],
|
||||
),
|
||||
|
||||
@@ -40,12 +40,22 @@ class WDeliveryHeader extends StatelessWidget {
|
||||
spacing: 12,
|
||||
children: [
|
||||
WCategoriesHeaderItem(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
context.push(
|
||||
Routes.restaurantsByCategory,
|
||||
extra: context.loc.american,
|
||||
);
|
||||
},
|
||||
text: context.loc.american,
|
||||
imageUrl: AppImages.imgAmerican,
|
||||
),
|
||||
WCategoriesHeaderItem(
|
||||
onTap: () {},
|
||||
onTap: () {
|
||||
context.push(
|
||||
Routes.restaurantsByCategory,
|
||||
extra: context.loc.grocery,
|
||||
);
|
||||
},
|
||||
text: context.loc.grocery,
|
||||
imageUrl: AppImages.imgGrocery,
|
||||
),
|
||||
@@ -71,6 +81,11 @@ class WDeliveryHeader extends StatelessWidget {
|
||||
onTap: () {
|
||||
if (index == 3) {
|
||||
CategoriesPage().show(context);
|
||||
} else {
|
||||
context.push(
|
||||
Routes.restaurantsByCategory,
|
||||
extra: _titles[index],
|
||||
);
|
||||
}
|
||||
},
|
||||
imgUrl: index != 3 ? _images[index] : null,
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import '../../../../../food_delivery_client.dart';
|
||||
|
||||
class RestaurantsByCategoryPage extends StatelessWidget {
|
||||
const RestaurantsByCategoryPage({super.key, required this.categoryName});
|
||||
|
||||
final String categoryName;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return WLayout(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
onPressed: () {
|
||||
context.pop();
|
||||
},
|
||||
icon: SvgPicture.asset(AppIcons.icBack),
|
||||
),
|
||||
),
|
||||
body: WRestaurantsByCategoryBody(categoryName: categoryName),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class WFeaturedStores extends StatelessWidget {
|
||||
const WFeaturedStores({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SizedBox(
|
||||
height: 200,
|
||||
child: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) => WFeaturedStoresItem(),
|
||||
separatorBuilder: (context, index) => 7.horizontalSpace,
|
||||
itemCount: 10,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class WFeaturedStoresItem extends StatelessWidget {
|
||||
const WFeaturedStoresItem({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
borderRadius: AppUtils.kBorderRadius16,
|
||||
child: Ink(
|
||||
height: 200,
|
||||
width: 165,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.cEFF3FE,
|
||||
borderRadius: AppUtils.kBorderRadius16,
|
||||
),
|
||||
child: Column(
|
||||
spacing: 20,
|
||||
children: [
|
||||
Expanded(
|
||||
child: CachedNetworkImage(imageUrl: AppLocaleKeys.imageUrl),
|
||||
),
|
||||
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text("7Eleven", style: AppTextStyles.size16Medium),
|
||||
Text(
|
||||
context.loc.opensAt("10:00 AM"),
|
||||
textAlign: TextAlign.center,
|
||||
style: AppTextStyles.size14Regular.copyWith(
|
||||
color: AppColors.c6B6B6B,
|
||||
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
).paddingAll(20),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class WRestaurantsByCategoryBody extends StatelessWidget {
|
||||
const WRestaurantsByCategoryBody({super.key, required this.categoryName});
|
||||
|
||||
final String categoryName;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.vertical,
|
||||
physics: const AlwaysScrollableScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
categoryName,
|
||||
style: AppTextStyles.size36Bold.copyWith(
|
||||
height: 44/36
|
||||
),
|
||||
).paddingSymmetric(horizontal: 15),
|
||||
15.verticalSpace,
|
||||
Text(
|
||||
context.loc.featuredStores,
|
||||
style: AppTextStyles.size30Bold.copyWith(
|
||||
height: 44/30
|
||||
),
|
||||
).paddingSymmetric(horizontal: 15),
|
||||
15.verticalSpace,
|
||||
WFeaturedStores(),
|
||||
16.verticalSpace,
|
||||
WDivider(),
|
||||
WStoresList()
|
||||
|
||||
|
||||
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
import '../../../../../../food_delivery_client.dart';
|
||||
|
||||
class WStoresList extends StatelessWidget {
|
||||
const WStoresList({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: 20,
|
||||
shrinkWrap: true,
|
||||
padding: EdgeInsets.symmetric(vertical: 17),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return WStoreItem();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class WStoreItem extends StatelessWidget {
|
||||
const WStoreItem({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return InkWell(
|
||||
onTap: () {},
|
||||
child: Ink(
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ClipRRect(
|
||||
borderRadius: AppUtils.kBorderRadius36,
|
||||
child: CachedNetworkImage(
|
||||
imageUrl: AppLocaleKeys.imageUrl,
|
||||
height: 70,
|
||||
width: 70,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
16.horizontalSpace,
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text("Begs & Megs", style: AppTextStyles.size16Medium),
|
||||
Text(
|
||||
context.loc.opensAt("10:00"),
|
||||
style: AppTextStyles.size14Regular.copyWith(
|
||||
color: AppColors.c6B6B6B,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
context.loc.spendAndSave("\$20", "\$5"),
|
||||
style: AppTextStyles.size14Medium.copyWith(
|
||||
color: AppColors.c05A357,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
IconButton(
|
||||
onPressed: () {},
|
||||
icon: SvgPicture.asset(AppIcons.icDislikeGrey),
|
||||
),
|
||||
],
|
||||
).paddingSymmetric(vertical: 10, horizontal: 18),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user