feat: reward -> poin
This commit is contained in:
parent
2d596a25b9
commit
30a2bece41
@ -16,6 +16,19 @@ class ThemeApp {
|
||||
fontFamily: FontFamily.quicksand,
|
||||
primaryColor: AppColor.primary,
|
||||
scaffoldBackgroundColor: AppColor.white,
|
||||
textTheme: TextTheme(
|
||||
bodySmall: AppStyle.xs,
|
||||
bodyMedium: AppStyle.md,
|
||||
bodyLarge: AppStyle.lg,
|
||||
labelSmall: AppStyle.sm,
|
||||
labelLarge: AppStyle.xl,
|
||||
headlineSmall: AppStyle.h6,
|
||||
headlineMedium: AppStyle.h5,
|
||||
headlineLarge: AppStyle.h4,
|
||||
displaySmall: AppStyle.h3,
|
||||
displayMedium: AppStyle.h2,
|
||||
displayLarge: AppStyle.h1,
|
||||
),
|
||||
appBarTheme: AppBarTheme(
|
||||
backgroundColor: AppColor.white,
|
||||
foregroundColor: AppColor.textPrimary,
|
||||
|
||||
@ -17,7 +17,7 @@ class HomeFeatureSection extends StatelessWidget {
|
||||
icon: Icons.card_giftcard,
|
||||
title: 'Reward',
|
||||
iconColor: const Color(0xFF1976D2),
|
||||
onTap: () => context.router.push(RewardRoute()),
|
||||
onTap: () {},
|
||||
),
|
||||
HomeFeatureCard(
|
||||
icon: Icons.casino,
|
||||
|
||||
@ -1,139 +1,144 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../router/app_router.gr.dart';
|
||||
|
||||
class HomePointCard extends StatelessWidget {
|
||||
const HomePointCard({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.textLight.withOpacity(0.15),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildCoinPattern(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.stars,
|
||||
color: AppColor.white,
|
||||
size: 18,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'148 Poin',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Kamu punya 148 poin',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
width: 120,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
return GestureDetector(
|
||||
onTap: () => context.router.push(PoinRoute()),
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.textLight.withOpacity(0.15),
|
||||
spreadRadius: 0,
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildCoinPattern(),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildCoin(
|
||||
right: 0,
|
||||
top: 0,
|
||||
size: 24,
|
||||
color: Colors.amber,
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 10,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.circular(25),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.stars,
|
||||
color: AppColor.white,
|
||||
size: 18,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'148 Poin',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.white,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildCoin(
|
||||
right: 20,
|
||||
top: 8,
|
||||
size: 20,
|
||||
color: Colors.orange,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 40,
|
||||
top: 4,
|
||||
size: 18,
|
||||
color: Colors.amber,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 60,
|
||||
top: 12,
|
||||
size: 16,
|
||||
color: Colors.orange,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 80,
|
||||
top: 8,
|
||||
size: 14,
|
||||
color: Colors.amber,
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Kamu punya 148 poin',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontSize: 11,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Tukarkan poinmu dengan hadiah menarik',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: AppColor.textPrimary,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
const Spacer(),
|
||||
SizedBox(
|
||||
width: 120,
|
||||
height: 40,
|
||||
child: Stack(
|
||||
children: [
|
||||
_buildCoin(
|
||||
right: 0,
|
||||
top: 0,
|
||||
size: 24,
|
||||
color: Colors.amber,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 20,
|
||||
top: 8,
|
||||
size: 20,
|
||||
color: Colors.orange,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 40,
|
||||
top: 4,
|
||||
size: 18,
|
||||
color: Colors.amber,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 60,
|
||||
top: 12,
|
||||
size: 16,
|
||||
color: Colors.orange,
|
||||
),
|
||||
_buildCoin(
|
||||
right: 80,
|
||||
top: 8,
|
||||
size: 14,
|
||||
color: Colors.amber,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: AppColor.textSecondary,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Row(
|
||||
children: [
|
||||
Text(
|
||||
'Tukarkan poinmu dengan hadiah menarik',
|
||||
style: AppStyle.sm.copyWith(
|
||||
color: AppColor.textPrimary,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
const Spacer(),
|
||||
Icon(
|
||||
Icons.arrow_forward_ios,
|
||||
color: AppColor.textSecondary,
|
||||
size: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@ import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../common/theme/theme.dart';
|
||||
import '../../reward_page.dart';
|
||||
import '../../poin_page.dart';
|
||||
|
||||
@RoutePage()
|
||||
class ProductRedeemPage extends StatefulWidget {
|
||||
@ -72,14 +72,14 @@ class Product {
|
||||
}
|
||||
|
||||
@RoutePage()
|
||||
class RewardPage extends StatefulWidget {
|
||||
const RewardPage({super.key});
|
||||
class PoinPage extends StatefulWidget {
|
||||
const PoinPage({super.key});
|
||||
|
||||
@override
|
||||
State<RewardPage> createState() => _RewardPageState();
|
||||
State<PoinPage> createState() => _PoinPageState();
|
||||
}
|
||||
|
||||
class _RewardPageState extends State<RewardPage> {
|
||||
class _PoinPageState extends State<PoinPage> {
|
||||
final ScrollController _scrollController = ScrollController();
|
||||
|
||||
// Sample data
|
||||
@ -299,14 +299,7 @@ class _RewardPageState extends State<RewardPage> {
|
||||
// Sticky AppBar
|
||||
SliverAppBar(
|
||||
elevation: 0,
|
||||
backgroundColor: AppColor.white,
|
||||
title: Text(
|
||||
"Rewards",
|
||||
style: AppStyle.h5.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
title: Text("Poin"),
|
||||
centerTitle: true,
|
||||
floating: false,
|
||||
pinned: true, // Made sticky
|
||||
@ -34,8 +34,8 @@ class AppRouter extends RootStackRouter {
|
||||
AutoRoute(page: MerchantRoute.page),
|
||||
AutoRoute(page: MerchantDetailRoute.page),
|
||||
|
||||
// Reward
|
||||
AutoRoute(page: RewardRoute.page),
|
||||
// Point
|
||||
AutoRoute(page: PoinRoute.page),
|
||||
AutoRoute(page: ProductRedeemRoute.page),
|
||||
|
||||
// Draw
|
||||
|
||||
@ -18,7 +18,7 @@ import 'package:enaklo/presentation/pages/auth/password/password_page.dart'
|
||||
as _i14;
|
||||
import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i15;
|
||||
import 'package:enaklo/presentation/pages/auth/register/register_page.dart'
|
||||
as _i18;
|
||||
as _i19;
|
||||
import 'package:enaklo/presentation/pages/draw/draw_page.dart' as _i3;
|
||||
import 'package:enaklo/presentation/pages/draw/pages/draw_detail/draw_detail_page.dart'
|
||||
as _i2;
|
||||
@ -28,7 +28,7 @@ import 'package:enaklo/presentation/pages/main/pages/home/home_page.dart'
|
||||
import 'package:enaklo/presentation/pages/main/pages/order/order_page.dart'
|
||||
as _i12;
|
||||
import 'package:enaklo/presentation/pages/main/pages/profile/profile_page.dart'
|
||||
as _i17;
|
||||
as _i18;
|
||||
import 'package:enaklo/presentation/pages/main/pages/voucher/voucher_page.dart'
|
||||
as _i22;
|
||||
import 'package:enaklo/presentation/pages/merchant/merchant_page.dart' as _i8;
|
||||
@ -40,9 +40,9 @@ import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart'
|
||||
as _i10;
|
||||
import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart'
|
||||
as _i11;
|
||||
import 'package:enaklo/presentation/pages/reward/pages/product_redeem/product_redeem_page.dart'
|
||||
as _i16;
|
||||
import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i19;
|
||||
import 'package:enaklo/presentation/pages/poin/pages/product_redeem/product_redeem_page.dart'
|
||||
as _i17;
|
||||
import 'package:enaklo/presentation/pages/poin/poin_page.dart' as _i16;
|
||||
import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i20;
|
||||
import 'package:enaklo/presentation/pages/voucher/voucher_detail/voucher_detail_page.dart'
|
||||
as _i21;
|
||||
@ -382,13 +382,29 @@ class PinRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i16.ProductRedeemPage]
|
||||
/// [_i16.PoinPage]
|
||||
class PoinRoute extends _i23.PageRouteInfo<void> {
|
||||
const PoinRoute({List<_i23.PageRouteInfo>? children})
|
||||
: super(PoinRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'PoinRoute';
|
||||
|
||||
static _i23.PageInfo page = _i23.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i16.PoinPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i17.ProductRedeemPage]
|
||||
class ProductRedeemRoute extends _i23.PageRouteInfo<ProductRedeemRouteArgs> {
|
||||
ProductRedeemRoute({
|
||||
_i24.Key? key,
|
||||
required _i19.Product product,
|
||||
required _i19.Merchant merchant,
|
||||
required _i19.PointCard pointCard,
|
||||
required _i16.Product product,
|
||||
required _i16.Merchant merchant,
|
||||
required _i16.PointCard pointCard,
|
||||
List<_i23.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
ProductRedeemRoute.name,
|
||||
@ -407,7 +423,7 @@ class ProductRedeemRoute extends _i23.PageRouteInfo<ProductRedeemRouteArgs> {
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<ProductRedeemRouteArgs>();
|
||||
return _i16.ProductRedeemPage(
|
||||
return _i17.ProductRedeemPage(
|
||||
key: args.key,
|
||||
product: args.product,
|
||||
merchant: args.merchant,
|
||||
@ -427,11 +443,11 @@ class ProductRedeemRouteArgs {
|
||||
|
||||
final _i24.Key? key;
|
||||
|
||||
final _i19.Product product;
|
||||
final _i16.Product product;
|
||||
|
||||
final _i19.Merchant merchant;
|
||||
final _i16.Merchant merchant;
|
||||
|
||||
final _i19.PointCard pointCard;
|
||||
final _i16.PointCard pointCard;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -440,7 +456,7 @@ class ProductRedeemRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i17.ProfilePage]
|
||||
/// [_i18.ProfilePage]
|
||||
class ProfileRoute extends _i23.PageRouteInfo<void> {
|
||||
const ProfileRoute({List<_i23.PageRouteInfo>? children})
|
||||
: super(ProfileRoute.name, initialChildren: children);
|
||||
@ -450,13 +466,13 @@ class ProfileRoute extends _i23.PageRouteInfo<void> {
|
||||
static _i23.PageInfo page = _i23.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i17.ProfilePage();
|
||||
return const _i18.ProfilePage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i18.RegisterPage]
|
||||
/// [_i19.RegisterPage]
|
||||
class RegisterRoute extends _i23.PageRouteInfo<void> {
|
||||
const RegisterRoute({List<_i23.PageRouteInfo>? children})
|
||||
: super(RegisterRoute.name, initialChildren: children);
|
||||
@ -466,23 +482,7 @@ class RegisterRoute extends _i23.PageRouteInfo<void> {
|
||||
static _i23.PageInfo page = _i23.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i18.RegisterPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i19.RewardPage]
|
||||
class RewardRoute extends _i23.PageRouteInfo<void> {
|
||||
const RewardRoute({List<_i23.PageRouteInfo>? children})
|
||||
: super(RewardRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'RewardRoute';
|
||||
|
||||
static _i23.PageInfo page = _i23.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i19.RewardPage();
|
||||
return const _i19.RegisterPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user