menu page
This commit is contained in:
@@ -8,10 +8,10 @@ import '../../../../../application/customer/customer_point_loader/customer_point
|
||||
import '../../../../../common/theme/theme.dart';
|
||||
import '../../../../components/image/image.dart';
|
||||
import '../../../../router/app_router.gr.dart';
|
||||
import 'widgets/feature_section.dart';
|
||||
import 'widgets/lottery_card.dart';
|
||||
import 'widgets/point_card.dart';
|
||||
import 'widgets/popular_merchant_section.dart';
|
||||
import 'widgets/service_section.dart';
|
||||
|
||||
@RoutePage()
|
||||
class HomePage extends StatefulWidget {
|
||||
@@ -52,7 +52,7 @@ class _HomePageState extends State<HomePage> {
|
||||
children: [
|
||||
_buildHeaderSection(),
|
||||
const SizedBox(height: 70),
|
||||
HomeFeatureSection(),
|
||||
HomeServiceSection(),
|
||||
HomeLotteryBanner(onTap: () => context.router.push(DrawRoute())),
|
||||
HomePopularMerchantSection(),
|
||||
],
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../../common/data/service_data.dart';
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../components/card/gradient_card.dart';
|
||||
import '../../../../../router/app_router.gr.dart';
|
||||
|
||||
class HomeServiceSection extends StatelessWidget {
|
||||
const HomeServiceSection({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: List.generate(services.length, (index) {
|
||||
return Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: index == 0 ? 12 : 0),
|
||||
child: InkWell(
|
||||
onTap: () =>
|
||||
context.router.push(MenuRoute(service: services[index])),
|
||||
child: GradientCard(
|
||||
child: _content(
|
||||
services[index].name,
|
||||
services[index].description,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Column _content(String title, String subtitle) {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
title,
|
||||
style: AppStyle.lg.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Text(
|
||||
subtitle,
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user