From 4d994e303ba0329b606f2ab3267bffe1faed32c3 Mon Sep 17 00:00:00 2001 From: efrilm Date: Fri, 29 Aug 2025 21:52:34 +0700 Subject: [PATCH] feat: address page and payment page --- .../pages/account/address/address_page.dart | 398 +++++++++++++++++ .../pages/account/payment/payment_page.dart | 218 ++++++++++ .../main/pages/profile/profile_page.dart | 4 +- lib/presentation/router/app_router.dart | 2 + lib/presentation/router/app_router.gr.dart | 402 ++++++++++-------- 5 files changed, 839 insertions(+), 185 deletions(-) create mode 100644 lib/presentation/pages/account/address/address_page.dart create mode 100644 lib/presentation/pages/account/payment/payment_page.dart diff --git a/lib/presentation/pages/account/address/address_page.dart b/lib/presentation/pages/account/address/address_page.dart new file mode 100644 index 0000000..ffefd87 --- /dev/null +++ b/lib/presentation/pages/account/address/address_page.dart @@ -0,0 +1,398 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +import '../../../../common/theme/theme.dart'; + +@RoutePage() +class AddressPage extends StatefulWidget { + const AddressPage({super.key}); + + @override + State createState() => _AddressPageState(); +} + +class _AddressPageState extends State { + // Sample saved addresses - replace with your actual data source + final List> savedAddresses = [ + { + 'id': '1', + 'label': 'Rumah', + 'name': 'John Doe', + 'phone': '081234567890', + 'fullAddress': 'Jl. Merdeka No. 123, RT 01/RW 02, Menteng', + 'city': 'Jakarta Pusat', + 'province': 'DKI Jakarta', + 'postalCode': '10110', + 'isDefault': true, + }, + { + 'id': '2', + 'label': 'Kantor', + 'name': 'John Doe', + 'phone': '081234567890', + 'fullAddress': 'Jl. Sudirman No. 456, Lantai 10, SCBD', + 'city': 'Jakarta Selatan', + 'province': 'DKI Jakarta', + 'postalCode': '12190', + 'isDefault': false, + }, + { + 'id': '3', + 'label': 'Apartemen', + 'name': 'Jane Doe', + 'phone': '087654321098', + 'fullAddress': 'Jl. Casablanca Raya No. 789, Tower A Unit 15B', + 'city': 'Jakarta Selatan', + 'province': 'DKI Jakarta', + 'postalCode': '12870', + 'isDefault': false, + }, + ]; + + void _setDefaultAddress(String addressId) { + setState(() { + for (var address in savedAddresses) { + address['isDefault'] = address['id'] == addressId; + } + }); + + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + 'Alamat utama berhasil diubah', + style: AppStyle.md.copyWith(color: AppColor.white), + ), + backgroundColor: AppColor.success, + behavior: SnackBarBehavior.floating, + ), + ); + } + + void _deleteAddress(String addressId) { + setState(() { + savedAddresses.removeWhere((address) => address['id'] == addressId); + }); + + ScaffoldMessenger.of(context).showSnackBar( + SnackBar( + content: Text( + 'Alamat berhasil dihapus', + style: AppStyle.md.copyWith(color: AppColor.white), + ), + backgroundColor: AppColor.success, + behavior: SnackBarBehavior.floating, + ), + ); + } + + void _showDeleteDialog(String addressId, String label) { + showDialog( + context: context, + builder: (BuildContext context) { + return AlertDialog( + backgroundColor: AppColor.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(12), + ), + title: Text( + 'Hapus Alamat', + style: AppStyle.lg.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textPrimary, + ), + ), + content: Text( + 'Apakah Anda yakin ingin menghapus alamat "$label"?', + style: AppStyle.md.copyWith(color: AppColor.textSecondary), + ), + actions: [ + TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + 'Batal', + style: AppStyle.md.copyWith(color: AppColor.textSecondary), + ), + ), + ElevatedButton( + onPressed: () { + Navigator.pop(context); + _deleteAddress(addressId); + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.error, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(6), + ), + ), + child: Text( + 'Hapus', + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w600, + ), + ), + ), + ], + ); + }, + ); + } + + Widget _buildAddressCard(Map address) { + return Container( + decoration: BoxDecoration( + color: AppColor.white, + border: Border(bottom: BorderSide(color: AppColor.border, width: 1)), + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + decoration: BoxDecoration( + color: AppColor.background, + borderRadius: BorderRadius.circular(4), + border: Border.all(color: AppColor.border), + ), + child: Text( + address['label'], + style: AppStyle.xs.copyWith( + color: AppColor.textPrimary, + fontWeight: FontWeight.w500, + ), + ), + ), + if (address['isDefault']) ...[ + const SizedBox(width: 8), + Container( + padding: const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), + decoration: BoxDecoration( + color: AppColor.primary, + borderRadius: BorderRadius.circular(4), + ), + child: Text( + 'Utama', + style: AppStyle.xs.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w500, + ), + ), + ), + ], + const Spacer(), + PopupMenuButton( + color: AppColor.white, + + icon: const Icon( + Icons.more_vert, + color: AppColor.textSecondary, + size: 20, + ), + onSelected: (value) { + switch (value) { + case 'edit': + // Navigate to edit form + break; + case 'default': + _setDefaultAddress(address['id']); + break; + case 'delete': + _showDeleteDialog(address['id'], address['label']); + break; + } + }, + itemBuilder: (context) => [ + PopupMenuItem( + value: 'edit', + child: Text( + 'Edit Alamat', + style: AppStyle.sm.copyWith( + color: AppColor.textPrimary, + ), + ), + ), + if (!address['isDefault']) + PopupMenuItem( + value: 'default', + child: Text( + 'Jadikan Utama', + style: AppStyle.sm.copyWith( + color: AppColor.textPrimary, + ), + ), + ), + PopupMenuItem( + value: 'delete', + child: Text( + 'Hapus Alamat', + style: AppStyle.sm.copyWith(color: AppColor.error), + ), + ), + ], + ), + ], + ), + const SizedBox(height: 12), + Text( + address['name'], + style: AppStyle.md.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textPrimary, + ), + ), + const SizedBox(height: 4), + Text( + address['phone'], + style: AppStyle.sm.copyWith(color: AppColor.textSecondary), + ), + const SizedBox(height: 8), + Text( + address['fullAddress'], + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + height: 1.4, + ), + ), + const SizedBox(height: 4), + Text( + '${address['city']}, ${address['province']} ${address['postalCode']}', + style: AppStyle.sm.copyWith(color: AppColor.textSecondary), + ), + ], + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.background, + appBar: AppBar(title: Text('Alamat Tersimpan')), + body: savedAddresses.isEmpty + ? _buildEmptyState() + : Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: savedAddresses.length, + itemBuilder: (context, index) { + return _buildAddressCard(savedAddresses[index]); + }, + ), + ), + Container( + padding: const EdgeInsets.all(20), + decoration: const BoxDecoration( + color: AppColor.white, + border: Border(top: BorderSide(color: AppColor.border)), + ), + child: SafeArea( + child: SizedBox( + width: double.infinity, + height: 48, + child: ElevatedButton( + onPressed: () { + // Navigate to add new address form + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.primary, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon( + Icons.add, + color: AppColor.white, + size: 20, + ), + const SizedBox(width: 8), + Text( + 'Tambah Alamat Baru', + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ), + ), + ), + ], + ), + ); + } + + Widget _buildEmptyState() { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.location_off, size: 80, color: AppColor.textLight), + const SizedBox(height: 16), + Text( + 'Belum Ada Alamat Tersimpan', + style: AppStyle.lg.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textSecondary, + ), + ), + const SizedBox(height: 8), + Text( + 'Tambahkan alamat untuk memudahkan\nproses pengiriman', + textAlign: TextAlign.center, + style: AppStyle.md.copyWith(color: AppColor.textLight, height: 1.4), + ), + const SizedBox(height: 32), + SizedBox( + width: 200, + height: 48, + child: ElevatedButton( + onPressed: () { + // Navigate to add address form + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.primary, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.add, color: AppColor.white, size: 20), + const SizedBox(width: 8), + Text( + 'Tambah Alamat', + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/pages/account/payment/payment_page.dart b/lib/presentation/pages/account/payment/payment_page.dart new file mode 100644 index 0000000..b6bd020 --- /dev/null +++ b/lib/presentation/pages/account/payment/payment_page.dart @@ -0,0 +1,218 @@ +import 'package:auto_route/auto_route.dart'; +import 'package:flutter/material.dart'; + +import '../../../../common/theme/theme.dart'; +// Import your theme files here +// import 'theme.dart'; + +@RoutePage() +class PaymentPage extends StatefulWidget { + const PaymentPage({super.key}); + + @override + State createState() => _PaymentPageState(); +} + +class _PaymentPageState extends State { + // Sample saved payment methods data + final List> savedPaymentMethods = [ + { + 'id': '1', + 'type': 'credit_card', + 'name': 'Kartu Kredit', + 'details': '**** **** **** 1234', + 'cardType': 'Visa', + 'expiryDate': '12/26', + 'isDefault': true, + 'icon': Icons.credit_card, + }, + { + 'id': '2', + 'type': 'credit_card', + 'name': 'Kartu Debit', + 'details': '**** **** **** 5678', + 'cardType': 'Mastercard', + 'expiryDate': '08/27', + 'isDefault': false, + 'icon': Icons.credit_card, + }, + { + 'id': '3', + 'type': 'ewallet', + 'name': 'DANA', + 'details': '081234567890', + 'cardType': 'E-Wallet', + 'expiryDate': null, + 'isDefault': false, + 'icon': Icons.account_balance_wallet, + }, + { + 'id': '4', + 'type': 'ewallet', + 'name': 'GoPay', + 'details': '081234567890', + 'cardType': 'E-Wallet', + 'expiryDate': null, + 'isDefault': false, + 'icon': Icons.account_balance_wallet, + }, + { + 'id': '5', + 'type': 'bank_account', + 'name': 'BCA', + 'details': '**** **** 9012', + 'cardType': 'Bank Account', + 'expiryDate': null, + 'isDefault': false, + 'icon': Icons.account_balance, + }, + ]; + + Widget _buildPaymentCard(Map payment) { + return Container( + decoration: const BoxDecoration( + color: AppColor.white, + border: Border(bottom: BorderSide(color: AppColor.border)), + ), + child: Padding( + padding: const EdgeInsets.all(16), + child: Row( + children: [ + Container( + width: 48, + height: 48, + decoration: BoxDecoration( + color: AppColor.background, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.border), + ), + child: Icon(payment['icon'], color: AppColor.primary, size: 24), + ), + const SizedBox(width: 16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Text( + payment['name'], + style: AppStyle.md.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textPrimary, + ), + ), + ], + ), + const SizedBox(height: 4), + Row( + children: [ + Text( + payment['cardType'], + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + ), + ), + if (payment['expiryDate'] != null) ...[ + Text( + ' • ', + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + ), + ), + Text( + 'Exp: ${payment['expiryDate']}', + style: AppStyle.sm.copyWith( + color: AppColor.textSecondary, + ), + ), + ], + ], + ), + ], + ), + ), + ], + ), + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColor.background, + appBar: AppBar(title: Text('Metode Pembayaran')), + body: savedPaymentMethods.isEmpty + ? _buildEmptyState() + : Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: savedPaymentMethods.length, + itemBuilder: (context, index) { + return _buildPaymentCard(savedPaymentMethods[index]); + }, + ), + ), + ], + ), + ); + } + + Widget _buildEmptyState() { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon(Icons.payment_outlined, size: 80, color: AppColor.textLight), + const SizedBox(height: 16), + Text( + 'Belum Ada Metode Pembayaran', + style: AppStyle.lg.copyWith( + fontWeight: FontWeight.w600, + color: AppColor.textSecondary, + ), + ), + const SizedBox(height: 8), + Text( + 'Tambahkan kartu atau e-wallet untuk\nmemudahkan proses pembayaran', + textAlign: TextAlign.center, + style: AppStyle.md.copyWith(color: AppColor.textLight, height: 1.4), + ), + const SizedBox(height: 32), + SizedBox( + width: 220, + height: 48, + child: ElevatedButton( + onPressed: () { + // Navigate to add payment method form + }, + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.primary, + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + const Icon(Icons.add, color: AppColor.white, size: 20), + const SizedBox(width: 8), + Text( + 'Tambah Pembayaran', + style: AppStyle.md.copyWith( + color: AppColor.white, + fontWeight: FontWeight.w600, + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/pages/main/pages/profile/profile_page.dart b/lib/presentation/pages/main/pages/profile/profile_page.dart index 4d0942d..4bedde1 100644 --- a/lib/presentation/pages/main/pages/profile/profile_page.dart +++ b/lib/presentation/pages/main/pages/profile/profile_page.dart @@ -185,12 +185,12 @@ class ProfilePage extends StatelessWidget { _buildMenuItem( icon: Icons.location_on_outlined, title: 'Alamat Tersimpan', - onTap: () {}, + onTap: () => context.router.push(AddressRoute()), ), _buildMenuItem( icon: Icons.payment_outlined, title: 'Pembayaran', - onTap: () {}, + onTap: () => context.router.push(PaymentRoute()), ), _buildMenuItem( icon: Icons.help_outline, diff --git a/lib/presentation/router/app_router.dart b/lib/presentation/router/app_router.dart index 56bc9d6..0bdeb39 100644 --- a/lib/presentation/router/app_router.dart +++ b/lib/presentation/router/app_router.dart @@ -57,5 +57,7 @@ class AppRouter extends RootStackRouter { // Account AutoRoute(page: AccountMyRoute.page), + AutoRoute(page: AddressRoute.page), + AutoRoute(page: PaymentRoute.page), ]; } diff --git a/lib/presentation/router/app_router.gr.dart b/lib/presentation/router/app_router.gr.dart index f8b47ab..73092e6 100644 --- a/lib/presentation/router/app_router.gr.dart +++ b/lib/presentation/router/app_router.gr.dart @@ -9,60 +9,64 @@ // coverage:ignore-file // ignore_for_file: no_leading_underscores_for_library_prefixes -import 'package:auto_route/auto_route.dart' as _i26; +import 'package:auto_route/auto_route.dart' as _i28; import 'package:enaklo/presentation/pages/account/account_my/account_my_page.dart' as _i1; -import 'package:enaklo/presentation/pages/auth/create_password/create_password_page.dart' +import 'package:enaklo/presentation/pages/account/address/address_page.dart' as _i2; -import 'package:enaklo/presentation/pages/auth/login/login_page.dart' as _i6; -import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i14; -import 'package:enaklo/presentation/pages/auth/password/password_page.dart' - as _i15; -import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i16; -import 'package:enaklo/presentation/pages/auth/register/register_page.dart' - as _i21; -import 'package:enaklo/presentation/pages/draw/draw_page.dart' as _i4; -import 'package:enaklo/presentation/pages/draw/pages/draw_detail/draw_detail_page.dart' - as _i3; -import 'package:enaklo/presentation/pages/main/main_page.dart' as _i7; -import 'package:enaklo/presentation/pages/main/pages/home/home_page.dart' - as _i5; -import 'package:enaklo/presentation/pages/main/pages/order/order_page.dart' - as _i13; -import 'package:enaklo/presentation/pages/main/pages/profile/profile_page.dart' - as _i20; -import 'package:enaklo/presentation/pages/main/pages/voucher/voucher_page.dart' - as _i25; -import 'package:enaklo/presentation/pages/merchant/merchant_page.dart' as _i9; -import 'package:enaklo/presentation/pages/merchant/pages/merchant_detail/merchant_detail_page.dart' - as _i8; -import 'package:enaklo/presentation/pages/notification/notification_page.dart' - as _i10; -import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' - as _i11; -import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' - as _i12; -import 'package:enaklo/presentation/pages/poin/pages/poin_history_page.dart' +import 'package:enaklo/presentation/pages/account/payment/payment_page.dart' as _i17; -import 'package:enaklo/presentation/pages/poin/pages/product_redeem/product_redeem_page.dart' +import 'package:enaklo/presentation/pages/auth/create_password/create_password_page.dart' + as _i3; +import 'package:enaklo/presentation/pages/auth/login/login_page.dart' as _i7; +import 'package:enaklo/presentation/pages/auth/otp/otp_page.dart' as _i15; +import 'package:enaklo/presentation/pages/auth/password/password_page.dart' + as _i16; +import 'package:enaklo/presentation/pages/auth/pin/pin_page.dart' as _i18; +import 'package:enaklo/presentation/pages/auth/register/register_page.dart' + as _i23; +import 'package:enaklo/presentation/pages/draw/draw_page.dart' as _i5; +import 'package:enaklo/presentation/pages/draw/pages/draw_detail/draw_detail_page.dart' + as _i4; +import 'package:enaklo/presentation/pages/main/main_page.dart' as _i8; +import 'package:enaklo/presentation/pages/main/pages/home/home_page.dart' + as _i6; +import 'package:enaklo/presentation/pages/main/pages/order/order_page.dart' + as _i14; +import 'package:enaklo/presentation/pages/main/pages/profile/profile_page.dart' + as _i22; +import 'package:enaklo/presentation/pages/main/pages/voucher/voucher_page.dart' + as _i27; +import 'package:enaklo/presentation/pages/merchant/merchant_page.dart' as _i10; +import 'package:enaklo/presentation/pages/merchant/pages/merchant_detail/merchant_detail_page.dart' + as _i9; +import 'package:enaklo/presentation/pages/notification/notification_page.dart' + as _i11; +import 'package:enaklo/presentation/pages/onboarding/onboarding_page.dart' + as _i12; +import 'package:enaklo/presentation/pages/order/order_detail/order_detail_page.dart' + as _i13; +import 'package:enaklo/presentation/pages/poin/pages/poin_history_page.dart' as _i19; -import 'package:enaklo/presentation/pages/poin/poin_page.dart' as _i18; -import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i22; -import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i23; +import 'package:enaklo/presentation/pages/poin/pages/product_redeem/product_redeem_page.dart' + as _i21; +import 'package:enaklo/presentation/pages/poin/poin_page.dart' as _i20; +import 'package:enaklo/presentation/pages/reward/reward_page.dart' as _i24; +import 'package:enaklo/presentation/pages/splash/splash_page.dart' as _i25; import 'package:enaklo/presentation/pages/voucher/voucher_detail/voucher_detail_page.dart' - as _i24; -import 'package:enaklo/sample/sample_data.dart' as _i28; -import 'package:flutter/material.dart' as _i27; + as _i26; +import 'package:enaklo/sample/sample_data.dart' as _i30; +import 'package:flutter/material.dart' as _i29; /// generated route for /// [_i1.AccountMyPage] -class AccountMyRoute extends _i26.PageRouteInfo { - const AccountMyRoute({List<_i26.PageRouteInfo>? children}) +class AccountMyRoute extends _i28.PageRouteInfo { + const AccountMyRoute({List<_i28.PageRouteInfo>? children}) : super(AccountMyRoute.name, initialChildren: children); static const String name = 'AccountMyRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { return const _i1.AccountMyPage(); @@ -71,28 +75,44 @@ class AccountMyRoute extends _i26.PageRouteInfo { } /// generated route for -/// [_i2.CreatePasswordPage] -class CreatePasswordRoute extends _i26.PageRouteInfo { - const CreatePasswordRoute({List<_i26.PageRouteInfo>? children}) - : super(CreatePasswordRoute.name, initialChildren: children); +/// [_i2.AddressPage] +class AddressRoute extends _i28.PageRouteInfo { + const AddressRoute({List<_i28.PageRouteInfo>? children}) + : super(AddressRoute.name, initialChildren: children); - static const String name = 'CreatePasswordRoute'; + static const String name = 'AddressRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i2.CreatePasswordPage(); + return const _i2.AddressPage(); }, ); } /// generated route for -/// [_i3.DrawDetailPage] -class DrawDetailRoute extends _i26.PageRouteInfo { +/// [_i3.CreatePasswordPage] +class CreatePasswordRoute extends _i28.PageRouteInfo { + const CreatePasswordRoute({List<_i28.PageRouteInfo>? children}) + : super(CreatePasswordRoute.name, initialChildren: children); + + static const String name = 'CreatePasswordRoute'; + + static _i28.PageInfo page = _i28.PageInfo( + name, + builder: (data) { + return const _i3.CreatePasswordPage(); + }, + ); +} + +/// generated route for +/// [_i4.DrawDetailPage] +class DrawDetailRoute extends _i28.PageRouteInfo { DrawDetailRoute({ - _i27.Key? key, - required _i4.DrawEvent drawEvent, - List<_i26.PageRouteInfo>? children, + _i29.Key? key, + required _i5.DrawEvent drawEvent, + List<_i28.PageRouteInfo>? children, }) : super( DrawDetailRoute.name, args: DrawDetailRouteArgs(key: key, drawEvent: drawEvent), @@ -101,11 +121,11 @@ class DrawDetailRoute extends _i26.PageRouteInfo { static const String name = 'DrawDetailRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i3.DrawDetailPage(key: args.key, drawEvent: args.drawEvent); + return _i4.DrawDetailPage(key: args.key, drawEvent: args.drawEvent); }, ); } @@ -113,9 +133,9 @@ class DrawDetailRoute extends _i26.PageRouteInfo { class DrawDetailRouteArgs { const DrawDetailRouteArgs({this.key, required this.drawEvent}); - final _i27.Key? key; + final _i29.Key? key; - final _i4.DrawEvent drawEvent; + final _i5.DrawEvent drawEvent; @override String toString() { @@ -124,76 +144,76 @@ class DrawDetailRouteArgs { } /// generated route for -/// [_i4.DrawPage] -class DrawRoute extends _i26.PageRouteInfo { - const DrawRoute({List<_i26.PageRouteInfo>? children}) +/// [_i5.DrawPage] +class DrawRoute extends _i28.PageRouteInfo { + const DrawRoute({List<_i28.PageRouteInfo>? children}) : super(DrawRoute.name, initialChildren: children); static const String name = 'DrawRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i4.DrawPage(); + return const _i5.DrawPage(); }, ); } /// generated route for -/// [_i5.HomePage] -class HomeRoute extends _i26.PageRouteInfo { - const HomeRoute({List<_i26.PageRouteInfo>? children}) +/// [_i6.HomePage] +class HomeRoute extends _i28.PageRouteInfo { + const HomeRoute({List<_i28.PageRouteInfo>? children}) : super(HomeRoute.name, initialChildren: children); static const String name = 'HomeRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i5.HomePage(); + return const _i6.HomePage(); }, ); } /// generated route for -/// [_i6.LoginPage] -class LoginRoute extends _i26.PageRouteInfo { - const LoginRoute({List<_i26.PageRouteInfo>? children}) +/// [_i7.LoginPage] +class LoginRoute extends _i28.PageRouteInfo { + const LoginRoute({List<_i28.PageRouteInfo>? children}) : super(LoginRoute.name, initialChildren: children); static const String name = 'LoginRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i6.LoginPage(); + return const _i7.LoginPage(); }, ); } /// generated route for -/// [_i7.MainPage] -class MainRoute extends _i26.PageRouteInfo { - const MainRoute({List<_i26.PageRouteInfo>? children}) +/// [_i8.MainPage] +class MainRoute extends _i28.PageRouteInfo { + const MainRoute({List<_i28.PageRouteInfo>? children}) : super(MainRoute.name, initialChildren: children); static const String name = 'MainRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i7.MainPage(); + return const _i8.MainPage(); }, ); } /// generated route for -/// [_i8.MerchantDetailPage] -class MerchantDetailRoute extends _i26.PageRouteInfo { +/// [_i9.MerchantDetailPage] +class MerchantDetailRoute extends _i28.PageRouteInfo { MerchantDetailRoute({ - _i27.Key? key, - required _i28.MerchantModel merchant, - List<_i26.PageRouteInfo>? children, + _i29.Key? key, + required _i30.MerchantModel merchant, + List<_i28.PageRouteInfo>? children, }) : super( MerchantDetailRoute.name, args: MerchantDetailRouteArgs(key: key, merchant: merchant), @@ -202,11 +222,11 @@ class MerchantDetailRoute extends _i26.PageRouteInfo { static const String name = 'MerchantDetailRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i8.MerchantDetailPage(key: args.key, merchant: args.merchant); + return _i9.MerchantDetailPage(key: args.key, merchant: args.merchant); }, ); } @@ -214,9 +234,9 @@ class MerchantDetailRoute extends _i26.PageRouteInfo { class MerchantDetailRouteArgs { const MerchantDetailRouteArgs({this.key, required this.merchant}); - final _i27.Key? key; + final _i29.Key? key; - final _i28.MerchantModel merchant; + final _i30.MerchantModel merchant; @override String toString() { @@ -225,60 +245,60 @@ class MerchantDetailRouteArgs { } /// generated route for -/// [_i9.MerchantPage] -class MerchantRoute extends _i26.PageRouteInfo { - const MerchantRoute({List<_i26.PageRouteInfo>? children}) +/// [_i10.MerchantPage] +class MerchantRoute extends _i28.PageRouteInfo { + const MerchantRoute({List<_i28.PageRouteInfo>? children}) : super(MerchantRoute.name, initialChildren: children); static const String name = 'MerchantRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i9.MerchantPage(); + return const _i10.MerchantPage(); }, ); } /// generated route for -/// [_i10.NotificationPage] -class NotificationRoute extends _i26.PageRouteInfo { - const NotificationRoute({List<_i26.PageRouteInfo>? children}) +/// [_i11.NotificationPage] +class NotificationRoute extends _i28.PageRouteInfo { + const NotificationRoute({List<_i28.PageRouteInfo>? children}) : super(NotificationRoute.name, initialChildren: children); static const String name = 'NotificationRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i10.NotificationPage(); + return const _i11.NotificationPage(); }, ); } /// generated route for -/// [_i11.OnboardingPage] -class OnboardingRoute extends _i26.PageRouteInfo { - const OnboardingRoute({List<_i26.PageRouteInfo>? children}) +/// [_i12.OnboardingPage] +class OnboardingRoute extends _i28.PageRouteInfo { + const OnboardingRoute({List<_i28.PageRouteInfo>? children}) : super(OnboardingRoute.name, initialChildren: children); static const String name = 'OnboardingRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i11.OnboardingPage(); + return const _i12.OnboardingPage(); }, ); } /// generated route for -/// [_i12.OrderDetailPage] -class OrderDetailRoute extends _i26.PageRouteInfo { +/// [_i13.OrderDetailPage] +class OrderDetailRoute extends _i28.PageRouteInfo { OrderDetailRoute({ - _i27.Key? key, - required _i13.Order order, - List<_i26.PageRouteInfo>? children, + _i29.Key? key, + required _i14.Order order, + List<_i28.PageRouteInfo>? children, }) : super( OrderDetailRoute.name, args: OrderDetailRouteArgs(key: key, order: order), @@ -287,11 +307,11 @@ class OrderDetailRoute extends _i26.PageRouteInfo { static const String name = 'OrderDetailRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i12.OrderDetailPage(key: args.key, order: args.order); + return _i13.OrderDetailPage(key: args.key, order: args.order); }, ); } @@ -299,9 +319,9 @@ class OrderDetailRoute extends _i26.PageRouteInfo { class OrderDetailRouteArgs { const OrderDetailRouteArgs({this.key, required this.order}); - final _i27.Key? key; + final _i29.Key? key; - final _i13.Order order; + final _i14.Order order; @override String toString() { @@ -310,61 +330,77 @@ class OrderDetailRouteArgs { } /// generated route for -/// [_i13.OrderPage] -class OrderRoute extends _i26.PageRouteInfo { - const OrderRoute({List<_i26.PageRouteInfo>? children}) +/// [_i14.OrderPage] +class OrderRoute extends _i28.PageRouteInfo { + const OrderRoute({List<_i28.PageRouteInfo>? children}) : super(OrderRoute.name, initialChildren: children); static const String name = 'OrderRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i13.OrderPage(); + return const _i14.OrderPage(); }, ); } /// generated route for -/// [_i14.OtpPage] -class OtpRoute extends _i26.PageRouteInfo { - const OtpRoute({List<_i26.PageRouteInfo>? children}) +/// [_i15.OtpPage] +class OtpRoute extends _i28.PageRouteInfo { + const OtpRoute({List<_i28.PageRouteInfo>? children}) : super(OtpRoute.name, initialChildren: children); static const String name = 'OtpRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i14.OtpPage(); + return const _i15.OtpPage(); }, ); } /// generated route for -/// [_i15.PasswordPage] -class PasswordRoute extends _i26.PageRouteInfo { - const PasswordRoute({List<_i26.PageRouteInfo>? children}) +/// [_i16.PasswordPage] +class PasswordRoute extends _i28.PageRouteInfo { + const PasswordRoute({List<_i28.PageRouteInfo>? children}) : super(PasswordRoute.name, initialChildren: children); static const String name = 'PasswordRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i15.PasswordPage(); + return const _i16.PasswordPage(); }, ); } /// generated route for -/// [_i16.PinPage] -class PinRoute extends _i26.PageRouteInfo { +/// [_i17.PaymentPage] +class PaymentRoute extends _i28.PageRouteInfo { + const PaymentRoute({List<_i28.PageRouteInfo>? children}) + : super(PaymentRoute.name, initialChildren: children); + + static const String name = 'PaymentRoute'; + + static _i28.PageInfo page = _i28.PageInfo( + name, + builder: (data) { + return const _i17.PaymentPage(); + }, + ); +} + +/// generated route for +/// [_i18.PinPage] +class PinRoute extends _i28.PageRouteInfo { PinRoute({ - _i27.Key? key, + _i29.Key? key, bool isCreatePin = true, String? title, - List<_i26.PageRouteInfo>? children, + List<_i28.PageRouteInfo>? children, }) : super( PinRoute.name, args: PinRouteArgs(key: key, isCreatePin: isCreatePin, title: title), @@ -373,13 +409,13 @@ class PinRoute extends _i26.PageRouteInfo { static const String name = 'PinRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { final args = data.argsAs( orElse: () => const PinRouteArgs(), ); - return _i16.PinPage( + return _i18.PinPage( key: args.key, isCreatePin: args.isCreatePin, title: args.title, @@ -391,7 +427,7 @@ class PinRoute extends _i26.PageRouteInfo { class PinRouteArgs { const PinRouteArgs({this.key, this.isCreatePin = true, this.title}); - final _i27.Key? key; + final _i29.Key? key; final bool isCreatePin; @@ -404,45 +440,45 @@ class PinRouteArgs { } /// generated route for -/// [_i17.PoinHistoryPage] -class PoinHistoryRoute extends _i26.PageRouteInfo { - const PoinHistoryRoute({List<_i26.PageRouteInfo>? children}) +/// [_i19.PoinHistoryPage] +class PoinHistoryRoute extends _i28.PageRouteInfo { + const PoinHistoryRoute({List<_i28.PageRouteInfo>? children}) : super(PoinHistoryRoute.name, initialChildren: children); static const String name = 'PoinHistoryRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i17.PoinHistoryPage(); + return const _i19.PoinHistoryPage(); }, ); } /// generated route for -/// [_i18.PoinPage] -class PoinRoute extends _i26.PageRouteInfo { - const PoinRoute({List<_i26.PageRouteInfo>? children}) +/// [_i20.PoinPage] +class PoinRoute extends _i28.PageRouteInfo { + const PoinRoute({List<_i28.PageRouteInfo>? children}) : super(PoinRoute.name, initialChildren: children); static const String name = 'PoinRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i18.PoinPage(); + return const _i20.PoinPage(); }, ); } /// generated route for -/// [_i19.ProductRedeemPage] -class ProductRedeemRoute extends _i26.PageRouteInfo { +/// [_i21.ProductRedeemPage] +class ProductRedeemRoute extends _i28.PageRouteInfo { ProductRedeemRoute({ - _i27.Key? key, - required _i18.Product product, - required _i18.PointCard pointCard, - List<_i26.PageRouteInfo>? children, + _i29.Key? key, + required _i20.Product product, + required _i20.PointCard pointCard, + List<_i28.PageRouteInfo>? children, }) : super( ProductRedeemRoute.name, args: ProductRedeemRouteArgs( @@ -455,11 +491,11 @@ class ProductRedeemRoute extends _i26.PageRouteInfo { static const String name = 'ProductRedeemRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { final args = data.argsAs(); - return _i19.ProductRedeemPage( + return _i21.ProductRedeemPage( key: args.key, product: args.product, pointCard: args.pointCard, @@ -475,11 +511,11 @@ class ProductRedeemRouteArgs { required this.pointCard, }); - final _i27.Key? key; + final _i29.Key? key; - final _i18.Product product; + final _i20.Product product; - final _i18.PointCard pointCard; + final _i20.PointCard pointCard; @override String toString() { @@ -488,97 +524,97 @@ class ProductRedeemRouteArgs { } /// generated route for -/// [_i20.ProfilePage] -class ProfileRoute extends _i26.PageRouteInfo { - const ProfileRoute({List<_i26.PageRouteInfo>? children}) +/// [_i22.ProfilePage] +class ProfileRoute extends _i28.PageRouteInfo { + const ProfileRoute({List<_i28.PageRouteInfo>? children}) : super(ProfileRoute.name, initialChildren: children); static const String name = 'ProfileRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i20.ProfilePage(); + return const _i22.ProfilePage(); }, ); } /// generated route for -/// [_i21.RegisterPage] -class RegisterRoute extends _i26.PageRouteInfo { - const RegisterRoute({List<_i26.PageRouteInfo>? children}) +/// [_i23.RegisterPage] +class RegisterRoute extends _i28.PageRouteInfo { + const RegisterRoute({List<_i28.PageRouteInfo>? children}) : super(RegisterRoute.name, initialChildren: children); static const String name = 'RegisterRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i21.RegisterPage(); + return const _i23.RegisterPage(); }, ); } /// generated route for -/// [_i22.RewardPage] -class RewardRoute extends _i26.PageRouteInfo { - const RewardRoute({List<_i26.PageRouteInfo>? children}) +/// [_i24.RewardPage] +class RewardRoute extends _i28.PageRouteInfo { + const RewardRoute({List<_i28.PageRouteInfo>? children}) : super(RewardRoute.name, initialChildren: children); static const String name = 'RewardRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i22.RewardPage(); + return const _i24.RewardPage(); }, ); } /// generated route for -/// [_i23.SplashPage] -class SplashRoute extends _i26.PageRouteInfo { - const SplashRoute({List<_i26.PageRouteInfo>? children}) +/// [_i25.SplashPage] +class SplashRoute extends _i28.PageRouteInfo { + const SplashRoute({List<_i28.PageRouteInfo>? children}) : super(SplashRoute.name, initialChildren: children); static const String name = 'SplashRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i23.SplashPage(); + return const _i25.SplashPage(); }, ); } /// generated route for -/// [_i24.VoucherDetailPage] -class VoucherDetailRoute extends _i26.PageRouteInfo { - const VoucherDetailRoute({List<_i26.PageRouteInfo>? children}) +/// [_i26.VoucherDetailPage] +class VoucherDetailRoute extends _i28.PageRouteInfo { + const VoucherDetailRoute({List<_i28.PageRouteInfo>? children}) : super(VoucherDetailRoute.name, initialChildren: children); static const String name = 'VoucherDetailRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i24.VoucherDetailPage(); + return const _i26.VoucherDetailPage(); }, ); } /// generated route for -/// [_i25.VoucherPage] -class VoucherRoute extends _i26.PageRouteInfo { - const VoucherRoute({List<_i26.PageRouteInfo>? children}) +/// [_i27.VoucherPage] +class VoucherRoute extends _i28.PageRouteInfo { + const VoucherRoute({List<_i28.PageRouteInfo>? children}) : super(VoucherRoute.name, initialChildren: children); static const String name = 'VoucherRoute'; - static _i26.PageInfo page = _i26.PageInfo( + static _i28.PageInfo page = _i28.PageInfo( name, builder: (data) { - return const _i25.VoucherPage(); + return const _i27.VoucherPage(); }, ); }