update service type
This commit is contained in:
parent
4c12244d3c
commit
7887704a5c
@ -21,6 +21,6 @@ List<Service> services = [
|
|||||||
Service(
|
Service(
|
||||||
name: 'Take Away',
|
name: 'Take Away',
|
||||||
description: 'Pesan dan bawa pulang',
|
description: 'Pesan dan bawa pulang',
|
||||||
imagePath: Assets.icons.dineIn.path,
|
imagePath: Assets.icons.takeaway.path,
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|||||||
@ -5,10 +5,11 @@ import 'package:flutter_bloc/flutter_bloc.dart';
|
|||||||
|
|
||||||
import '../../../../../application/auth/auth_bloc.dart';
|
import '../../../../../application/auth/auth_bloc.dart';
|
||||||
import '../../../../../application/customer/customer_point_loader/customer_point_loader_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 '../../../../../common/theme/theme.dart';
|
||||||
import '../../../../components/image/image.dart';
|
import '../../../../components/image/image.dart';
|
||||||
import '../../../../router/app_router.gr.dart';
|
import '../../../../router/app_router.gr.dart';
|
||||||
import 'widgets/lottery_card.dart';
|
import 'widgets/banner_card.dart';
|
||||||
import 'widgets/point_card.dart';
|
import 'widgets/point_card.dart';
|
||||||
import 'widgets/popular_merchant_section.dart';
|
import 'widgets/popular_merchant_section.dart';
|
||||||
import 'widgets/service_section.dart';
|
import 'widgets/service_section.dart';
|
||||||
@ -53,7 +54,13 @@ class _HomePageState extends State<HomePage> {
|
|||||||
_buildHeaderSection(),
|
_buildHeaderSection(),
|
||||||
const SizedBox(height: 70),
|
const SizedBox(height: 70),
|
||||||
HomeServiceSection(),
|
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(),
|
HomePopularMerchantSection(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../../../../../../common/theme/theme.dart';
|
import '../../../../../../common/theme/theme.dart';
|
||||||
|
|
||||||
class HomeLotteryBanner extends StatefulWidget {
|
class HomeBanner extends StatefulWidget {
|
||||||
const HomeLotteryBanner({
|
const HomeBanner({
|
||||||
super.key,
|
super.key,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.title = "🎰 UNDIAN BERHADIAH",
|
this.title = "🎰 UNDIAN BERHADIAH",
|
||||||
@ -18,11 +18,10 @@ class HomeLotteryBanner extends StatefulWidget {
|
|||||||
final String actionText;
|
final String actionText;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HomeLotteryBanner> createState() => _HomeLotteryBannerState();
|
State<HomeBanner> createState() => _HomeBannerState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomeLotteryBannerState extends State<HomeLotteryBanner>
|
class _HomeBannerState extends State<HomeBanner> with TickerProviderStateMixin {
|
||||||
with TickerProviderStateMixin {
|
|
||||||
late AnimationController _pulseController;
|
late AnimationController _pulseController;
|
||||||
late AnimationController _shimmerController;
|
late AnimationController _shimmerController;
|
||||||
late AnimationController _floatingController;
|
late AnimationController _floatingController;
|
||||||
@ -290,7 +289,7 @@ class _HomeLotteryBannerState extends State<HomeLotteryBanner>
|
|||||||
children: [
|
children: [
|
||||||
const Center(
|
const Center(
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.casino,
|
Icons.games,
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
size: 32,
|
size: 32,
|
||||||
shadows: [
|
shadows: [
|
||||||
@ -23,10 +23,8 @@ class HomeServiceSection extends StatelessWidget {
|
|||||||
onTap: () =>
|
onTap: () =>
|
||||||
context.router.push(MenuRoute(service: services[index])),
|
context.router.push(MenuRoute(service: services[index])),
|
||||||
child: GradientCard(
|
child: GradientCard(
|
||||||
child: _content(
|
padding: EdgeInsets.zero,
|
||||||
services[index].name,
|
child: _content(services[index]),
|
||||||
services[index].description,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@ -36,12 +34,21 @@ class HomeServiceSection extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Column _content(String title, String subtitle) {
|
Stack _content(Service service) {
|
||||||
return Column(
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Positioned(
|
||||||
|
right: 4,
|
||||||
|
top: 4,
|
||||||
|
child: Image.asset(service.imagePath, width: 60, height: 60),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
title,
|
service.name,
|
||||||
style: AppStyle.lg.copyWith(
|
style: AppStyle.lg.copyWith(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
@ -49,13 +56,16 @@ class HomeServiceSection extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
Text(
|
Text(
|
||||||
subtitle,
|
service.description,
|
||||||
style: AppStyle.md.copyWith(
|
style: AppStyle.md.copyWith(
|
||||||
color: AppColor.white,
|
color: AppColor.white,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,7 +39,10 @@ class MenuHeader extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
// Service
|
// Service
|
||||||
Column(
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@ -58,6 +61,11 @@ class MenuHeader extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 12),
|
||||||
|
Image.asset(service.imagePath, width: 60, height: 60),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
SizedBox(height: 16),
|
SizedBox(height: 16),
|
||||||
// Merchant
|
// Merchant
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user