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