From 7887704a5c5bda3b4aab9b2373acb0e43bef9d37 Mon Sep 17 00:00:00 2001 From: Efril Date: Fri, 16 Jan 2026 16:07:56 +0700 Subject: [PATCH] update service type --- lib/common/data/service_data.dart | 2 +- .../pages/main/pages/home/home_page.dart | 11 ++++- .../{lottery_card.dart => banner_card.dart} | 11 ++--- .../pages/home/widgets/service_section.dart | 48 +++++++++++-------- .../pages/menu/widgets/header.dart | 36 ++++++++------ 5 files changed, 66 insertions(+), 42 deletions(-) rename lib/presentation/pages/main/pages/home/widgets/{lottery_card.dart => banner_card.dart} (97%) diff --git a/lib/common/data/service_data.dart b/lib/common/data/service_data.dart index 7a78c6a..b5ec3e2 100644 --- a/lib/common/data/service_data.dart +++ b/lib/common/data/service_data.dart @@ -21,6 +21,6 @@ List services = [ Service( name: 'Take Away', description: 'Pesan dan bawa pulang', - imagePath: Assets.icons.dineIn.path, + imagePath: Assets.icons.takeaway.path, ), ]; diff --git a/lib/presentation/pages/main/pages/home/home_page.dart b/lib/presentation/pages/main/pages/home/home_page.dart index 58eba95..ded7289 100644 --- a/lib/presentation/pages/main/pages/home/home_page.dart +++ b/lib/presentation/pages/main/pages/home/home_page.dart @@ -5,10 +5,11 @@ import 'package:flutter_bloc/flutter_bloc.dart'; import '../../../../../application/auth/auth_bloc.dart'; import '../../../../../application/customer/customer_point_loader/customer_point_loader_bloc.dart'; +import '../../../../../common/constant/app_constant.dart'; import '../../../../../common/theme/theme.dart'; import '../../../../components/image/image.dart'; import '../../../../router/app_router.gr.dart'; -import 'widgets/lottery_card.dart'; +import 'widgets/banner_card.dart'; import 'widgets/point_card.dart'; import 'widgets/popular_merchant_section.dart'; import 'widgets/service_section.dart'; @@ -53,7 +54,13 @@ class _HomePageState extends State { _buildHeaderSection(), const SizedBox(height: 70), HomeServiceSection(), - HomeLotteryBanner(onTap: () => context.router.push(DrawRoute())), + HomeBanner( + title: '🎰 My Rewards', + subtitle: + 'Main dan tepat menangkan produk gratis dari ${AppConstant.appName}.', + actionText: 'Mainkan Sekarang', + onTap: () => context.router.push(DrawRoute()), + ), HomePopularMerchantSection(), ], ), diff --git a/lib/presentation/pages/main/pages/home/widgets/lottery_card.dart b/lib/presentation/pages/main/pages/home/widgets/banner_card.dart similarity index 97% rename from lib/presentation/pages/main/pages/home/widgets/lottery_card.dart rename to lib/presentation/pages/main/pages/home/widgets/banner_card.dart index e516087..f33ae6f 100644 --- a/lib/presentation/pages/main/pages/home/widgets/lottery_card.dart +++ b/lib/presentation/pages/main/pages/home/widgets/banner_card.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import '../../../../../../common/theme/theme.dart'; -class HomeLotteryBanner extends StatefulWidget { - const HomeLotteryBanner({ +class HomeBanner extends StatefulWidget { + const HomeBanner({ super.key, this.onTap, this.title = "🎰 UNDIAN BERHADIAH", @@ -18,11 +18,10 @@ class HomeLotteryBanner extends StatefulWidget { final String actionText; @override - State createState() => _HomeLotteryBannerState(); + State createState() => _HomeBannerState(); } -class _HomeLotteryBannerState extends State - with TickerProviderStateMixin { +class _HomeBannerState extends State with TickerProviderStateMixin { late AnimationController _pulseController; late AnimationController _shimmerController; late AnimationController _floatingController; @@ -290,7 +289,7 @@ class _HomeLotteryBannerState extends State children: [ const Center( child: Icon( - Icons.casino, + Icons.games, color: Colors.white, size: 32, shadows: [ diff --git a/lib/presentation/pages/main/pages/home/widgets/service_section.dart b/lib/presentation/pages/main/pages/home/widgets/service_section.dart index f92dce4..c974de1 100644 --- a/lib/presentation/pages/main/pages/home/widgets/service_section.dart +++ b/lib/presentation/pages/main/pages/home/widgets/service_section.dart @@ -23,10 +23,8 @@ class HomeServiceSection extends StatelessWidget { onTap: () => context.router.push(MenuRoute(service: services[index])), child: GradientCard( - child: _content( - services[index].name, - services[index].description, - ), + padding: EdgeInsets.zero, + child: _content(services[index]), ), ), ), @@ -36,23 +34,35 @@ class HomeServiceSection extends StatelessWidget { ); } - Column _content(String title, String subtitle) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, + Stack _content(Service service) { + return Stack( children: [ - Text( - title, - style: AppStyle.lg.copyWith( - color: AppColor.white, - fontWeight: FontWeight.bold, - ), + Positioned( + right: 4, + top: 4, + child: Image.asset(service.imagePath, width: 60, height: 60), ), - SizedBox(height: 8), - Text( - subtitle, - style: AppStyle.md.copyWith( - color: AppColor.white, - fontWeight: FontWeight.w500, + Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + service.name, + style: AppStyle.lg.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + SizedBox(height: 8), + Text( + service.description, + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w500, + ), + ), + ], ), ), ], diff --git a/lib/presentation/pages/menu/widgets/header.dart b/lib/presentation/pages/menu/widgets/header.dart index 9152d0d..3fb076c 100644 --- a/lib/presentation/pages/menu/widgets/header.dart +++ b/lib/presentation/pages/menu/widgets/header.dart @@ -39,23 +39,31 @@ class MenuHeader extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ // Service - Column( - crossAxisAlignment: CrossAxisAlignment.start, + Row( children: [ - Text( - service.name, - style: AppStyle.lg.copyWith( - color: AppColor.white, - fontWeight: FontWeight.bold, - ), - ), - Text( - service.description, - style: AppStyle.md.copyWith( - color: AppColor.white, - fontWeight: FontWeight.w500, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + service.name, + style: AppStyle.lg.copyWith( + color: AppColor.white, + fontWeight: FontWeight.bold, + ), + ), + Text( + service.description, + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w500, + ), + ), + ], ), ), + SizedBox(width: 12), + Image.asset(service.imagePath, width: 60, height: 60), ], ),