Success Split Bill Page
This commit is contained in:
parent
35f02e6b76
commit
fecb4fb5c1
@ -1,3 +1,5 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:bloc/bloc.dart';
|
||||
import 'package:dartz/dartz.dart' hide Order;
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
@ -89,6 +91,8 @@ class PaymentFormBloc extends Bloc<PaymentFormEvent, PaymentFormState> {
|
||||
.toList(),
|
||||
);
|
||||
|
||||
log(request.toString());
|
||||
|
||||
failureOrPayment = await _repository.createSplitBill(request);
|
||||
|
||||
emit(
|
||||
|
||||
@ -20,7 +20,7 @@ mixin _$SplitBillFormEvent {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -29,7 +29,7 @@ mixin _$SplitBillFormEvent {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -38,7 +38,7 @@ mixin _$SplitBillFormEvent {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -180,7 +180,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -193,7 +193,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -206,7 +206,7 @@ class _$SetOrderImpl implements _SetOrder {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -282,9 +282,9 @@ abstract class _$$CustomerChangedImplCopyWith<$Res> {
|
||||
$Res Function(_$CustomerChangedImpl) then,
|
||||
) = __$$CustomerChangedImplCopyWithImpl<$Res>;
|
||||
@useResult
|
||||
$Res call({Customer customer});
|
||||
$Res call({Customer? customer});
|
||||
|
||||
$CustomerCopyWith<$Res> get customer;
|
||||
$CustomerCopyWith<$Res>? get customer;
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@ -300,13 +300,13 @@ class __$$CustomerChangedImplCopyWithImpl<$Res>
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({Object? customer = null}) {
|
||||
$Res call({Object? customer = freezed}) {
|
||||
return _then(
|
||||
_$CustomerChangedImpl(
|
||||
null == customer
|
||||
freezed == customer
|
||||
? _value.customer
|
||||
: customer // ignore: cast_nullable_to_non_nullable
|
||||
as Customer,
|
||||
as Customer?,
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -315,8 +315,12 @@ class __$$CustomerChangedImplCopyWithImpl<$Res>
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$CustomerCopyWith<$Res> get customer {
|
||||
return $CustomerCopyWith<$Res>(_value.customer, (value) {
|
||||
$CustomerCopyWith<$Res>? get customer {
|
||||
if (_value.customer == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $CustomerCopyWith<$Res>(_value.customer!, (value) {
|
||||
return _then(_value.copyWith(customer: value));
|
||||
});
|
||||
}
|
||||
@ -328,7 +332,7 @@ class _$CustomerChangedImpl implements _CustomerChanged {
|
||||
const _$CustomerChangedImpl(this.customer);
|
||||
|
||||
@override
|
||||
final Customer customer;
|
||||
final Customer? customer;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -362,7 +366,7 @@ class _$CustomerChangedImpl implements _CustomerChanged {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -375,7 +379,7 @@ class _$CustomerChangedImpl implements _CustomerChanged {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -388,7 +392,7 @@ class _$CustomerChangedImpl implements _CustomerChanged {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -446,10 +450,10 @@ class _$CustomerChangedImpl implements _CustomerChanged {
|
||||
}
|
||||
|
||||
abstract class _CustomerChanged implements SplitBillFormEvent {
|
||||
const factory _CustomerChanged(final Customer customer) =
|
||||
const factory _CustomerChanged(final Customer? customer) =
|
||||
_$CustomerChangedImpl;
|
||||
|
||||
Customer get customer;
|
||||
Customer? get customer;
|
||||
|
||||
/// Create a copy of SplitBillFormEvent
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@ -533,7 +537,7 @@ class _$CustomerNameChangedImpl implements _CustomerNameChanged {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -546,7 +550,7 @@ class _$CustomerNameChangedImpl implements _CustomerNameChanged {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -559,7 +563,7 @@ class _$CustomerNameChangedImpl implements _CustomerNameChanged {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -704,7 +708,7 @@ class _$SplitTypeChangedImpl implements _SplitTypeChanged {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -717,7 +721,7 @@ class _$SplitTypeChangedImpl implements _SplitTypeChanged {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -730,7 +734,7 @@ class _$SplitTypeChangedImpl implements _SplitTypeChanged {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -885,7 +889,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -898,7 +902,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -911,7 +915,7 @@ class _$ItemQuantityChangedImpl implements _ItemQuantityChanged {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -1055,7 +1059,7 @@ class _$AmountChangedImpl implements _AmountChanged {
|
||||
@optionalTypeArgs
|
||||
TResult when<TResult extends Object?>({
|
||||
required TResult Function(Order order) setOrder,
|
||||
required TResult Function(Customer customer) customerChanged,
|
||||
required TResult Function(Customer? customer) customerChanged,
|
||||
required TResult Function(String customerName) customerNameChanged,
|
||||
required TResult Function(SplitType splitType) splitTypeChanged,
|
||||
required TResult Function(String itemId, int quantity) itemQuantityChanged,
|
||||
@ -1068,7 +1072,7 @@ class _$AmountChangedImpl implements _AmountChanged {
|
||||
@optionalTypeArgs
|
||||
TResult? whenOrNull<TResult extends Object?>({
|
||||
TResult? Function(Order order)? setOrder,
|
||||
TResult? Function(Customer customer)? customerChanged,
|
||||
TResult? Function(Customer? customer)? customerChanged,
|
||||
TResult? Function(String customerName)? customerNameChanged,
|
||||
TResult? Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult? Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
@ -1081,7 +1085,7 @@ class _$AmountChangedImpl implements _AmountChanged {
|
||||
@optionalTypeArgs
|
||||
TResult maybeWhen<TResult extends Object?>({
|
||||
TResult Function(Order order)? setOrder,
|
||||
TResult Function(Customer customer)? customerChanged,
|
||||
TResult Function(Customer? customer)? customerChanged,
|
||||
TResult Function(String customerName)? customerNameChanged,
|
||||
TResult Function(SplitType splitType)? splitTypeChanged,
|
||||
TResult Function(String itemId, int quantity)? itemQuantityChanged,
|
||||
|
||||
@ -3,7 +3,7 @@ part of 'split_bill_form_bloc.dart';
|
||||
@freezed
|
||||
class SplitBillFormEvent with _$SplitBillFormEvent {
|
||||
const factory SplitBillFormEvent.setOrder(Order order) = _SetOrder;
|
||||
const factory SplitBillFormEvent.customerChanged(Customer customer) =
|
||||
const factory SplitBillFormEvent.customerChanged(Customer? customer) =
|
||||
_CustomerChanged;
|
||||
const factory SplitBillFormEvent.customerNameChanged(String customerName) =
|
||||
_CustomerNameChanged;
|
||||
|
||||
@ -240,6 +240,7 @@ class OrderRemoteDataProvider {
|
||||
Future<DC<OrderFailure, PaymentDto>> createSplitBill(
|
||||
PaymentSplitBillRequestDto request,
|
||||
) async {
|
||||
log(request.toRequest().toString());
|
||||
try {
|
||||
final response = await _apiClient.post(
|
||||
"${ApiPath.orders}/split-bill",
|
||||
|
||||
@ -106,6 +106,7 @@ class PaymentSplitBillRequestDto with _$PaymentSplitBillRequestDto {
|
||||
customerId: request.customerId,
|
||||
type: request.type.toStringType(),
|
||||
amount: request.amount,
|
||||
customerName: request.customerName,
|
||||
items: request.items
|
||||
.map((e) => PaymentItemSplitBillRequestDto.fromDomain(e))
|
||||
.toList(),
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../../../application/order/order_loader/order_loader_bloc.dart';
|
||||
import '../../../../../common/theme/theme.dart';
|
||||
import '../../../../../injection.dart';
|
||||
import '../../../../components/error/order_loader_error_state_widget.dart';
|
||||
import '../../../../components/loader/loader_with_text.dart';
|
||||
import 'widgets/payment_success_split_bill_left_panel.dart';
|
||||
import 'widgets/payment_success_split_bill_right_panel.dart';
|
||||
|
||||
@RoutePage()
|
||||
class PaymentSuccessSplitBillPage extends StatelessWidget
|
||||
implements AutoRouteWrapper {
|
||||
final String orderId;
|
||||
const PaymentSuccessSplitBillPage({super.key, required this.orderId});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColor.background,
|
||||
body: SafeArea(
|
||||
child: BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||
builder: (context, state) {
|
||||
if (state.isFetchingById) {
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
return state.failureOptionGetById.fold(
|
||||
() => Container(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Row(
|
||||
children: [
|
||||
// Left Panel - Success Message & Order Info
|
||||
Expanded(
|
||||
flex: 35,
|
||||
child: PaymentSuccessSplitBillLeftPanel(
|
||||
order: state.order,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// Right Panel - Order Details
|
||||
Expanded(
|
||||
flex: 65,
|
||||
child: PaymentSuccessSplitBillRightPanel(
|
||||
order: state.order,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
(f) => OrderLoaderErrorStateWidget(
|
||||
failure: f,
|
||||
onRefresh: () {
|
||||
context.read<OrderLoaderBloc>().add(
|
||||
OrderLoaderEvent.getById(orderId),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget wrappedRoute(BuildContext context) => BlocProvider(
|
||||
create: (context) =>
|
||||
getIt<OrderLoaderBloc>()..add(OrderLoaderEvent.getById(orderId)),
|
||||
child: this,
|
||||
);
|
||||
}
|
||||
@ -0,0 +1,247 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../../common/extension/extension.dart';
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../../domain/order/order.dart';
|
||||
import '../../../../../components/button/button.dart';
|
||||
import '../../../../../components/spaces/space.dart';
|
||||
import '../../../../../router/app_router.gr.dart';
|
||||
|
||||
class PaymentSuccessSplitBillLeftPanel extends StatelessWidget {
|
||||
final Order order;
|
||||
const PaymentSuccessSplitBillLeftPanel({super.key, required this.order});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(32.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColor.primary.withOpacity(0.1),
|
||||
AppColor.primary.withOpacity(0.05),
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(24),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColor.primary,
|
||||
AppColor.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.primary.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check_rounded,
|
||||
size: 48,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SpaceHeight(8),
|
||||
Text(
|
||||
'Pembayaran Berhasil!',
|
||||
style: AppStyle.h4.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Informasi Pesanan',
|
||||
style: AppStyle.lg.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
value: order.metadata['customer_name'] ?? "-",
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.splitscreen,
|
||||
label: 'Split Tipe',
|
||||
value: order.splitType,
|
||||
),
|
||||
if (order.payments.isNotEmpty) ...[
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.wallet_outlined,
|
||||
label: 'Metode Pembayaran',
|
||||
value: order.payments.first.paymentMethodName,
|
||||
),
|
||||
],
|
||||
if (order.tableNumber != "") ...[
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.table_restaurant_outlined,
|
||||
label: 'No. Meja',
|
||||
value: order.tableNumber,
|
||||
),
|
||||
],
|
||||
const SpaceHeight(12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.access_time_rounded,
|
||||
label: 'Waktu',
|
||||
value: (DateTime.now()).toFormattedDateTime(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
_buildBottomSection(context),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomSection(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Colors.grey.shade50, Colors.white],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(24)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Action Buttons with Modern Design
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: AppElevatedButton.outlined(
|
||||
onPressed: () =>
|
||||
context.router.replaceAll([const MainRoute()]),
|
||||
label: "Kembali",
|
||||
),
|
||||
),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: () {
|
||||
// onPrintRecipt(
|
||||
// context,
|
||||
// order: widget.order,
|
||||
// paymentMethod: widget.paymentMethod,
|
||||
// nominalBayar: widget.paymentMethod == "Cash"
|
||||
// ? widget.nominalBayar
|
||||
// : widget.order.totalAmount ?? 0,
|
||||
// kembalian: widget.nominalBayar -
|
||||
// (widget.order.totalAmount ?? 0),
|
||||
// productQuantity: widget.productQuantity,
|
||||
// );
|
||||
// onPrint(
|
||||
// context,
|
||||
// productQuantity: widget.productQuantity,
|
||||
// order: widget.order,
|
||||
// );
|
||||
},
|
||||
label: 'Cetak Struk',
|
||||
icon: Icon(Icons.print_rounded, color: AppColor.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow({
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required String value,
|
||||
Color? valueColor,
|
||||
bool showBadge = false,
|
||||
}) {
|
||||
return Row(
|
||||
children: [
|
||||
Icon(icon, size: 18, color: AppColor.primary),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
),
|
||||
),
|
||||
if (showBadge && valueColor != null)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: valueColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(Icons.check_circle, size: 14, color: valueColor),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
value,
|
||||
style: AppStyle.sm.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: valueColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
Text(
|
||||
value,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: valueColor ?? AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,325 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../../../../common/extension/extension.dart';
|
||||
import '../../../../../../common/theme/theme.dart';
|
||||
import '../../../../../../domain/order/order.dart';
|
||||
import '../../../../../components/border/dashed_border.dart';
|
||||
import '../../../../../components/spaces/space.dart';
|
||||
|
||||
class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
final Order order;
|
||||
const PaymentSuccessSplitBillRightPanel({super.key, required this.order});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
_header(),
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
itemCount: order.payments.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 12),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildPaymentCard(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
_buildSummaryFooter(),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSummaryFooter() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0).copyWith(top: 0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [Colors.grey.shade50, Colors.white],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(bottom: Radius.circular(24)),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Decorative Divider
|
||||
Container(
|
||||
height: 1,
|
||||
margin: const EdgeInsets.only(bottom: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
AppColor.primary.withOpacity(0.3),
|
||||
Colors.transparent,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Subtotal Row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Dibayar',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
(order.totalPaid).toString().currencyFormatRpV2,
|
||||
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SpaceHeight(8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Sisa Tagihan',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
(order.remainingAmount).toString().currencyFormatRpV2,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.error,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SpaceHeight(8),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total Tagihan',
|
||||
style: AppStyle.md.copyWith(
|
||||
color: AppColor.textSecondary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
(order.totalAmount).toString().currencyFormatRpV2,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SpaceHeight(16),
|
||||
|
||||
// Total Payment Row with Enhanced Styling
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColor.primary.withOpacity(0.1),
|
||||
AppColor.primary.withOpacity(0.05),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColor.primary.withOpacity(0.2),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.payments_rounded,
|
||||
size: 16,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColor.primary,
|
||||
AppColor.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.primary.withOpacity(0.3),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
(order.payments.last.amount).toString().currencyFormatRpV2,
|
||||
style: AppStyle.xl.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Row _buildPaymentCard(int index) {
|
||||
final payment = order.payments[index];
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 32,
|
||||
height: 32,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.primary.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(Icons.payments, color: AppColor.primary, size: 16),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
payment.paymentMethodName,
|
||||
style: AppStyle.md.copyWith(fontWeight: FontWeight.w500),
|
||||
),
|
||||
if ((payment.splitTotal) > 1)
|
||||
Text(
|
||||
'Split ${payment.splitNumber} of ${payment.splitTotal}',
|
||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Text(
|
||||
(payment.amount).currencyFormatRpV2,
|
||||
style: AppStyle.md.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container _header() {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: AppColor.border)),
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColor.primary.withOpacity(0.2),
|
||||
AppColor.primary.withOpacity(0.1),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.receipt_long_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Daftar Split Bill',
|
||||
style: AppStyle.xxl.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
Text(
|
||||
'Ringkasan split bill',
|
||||
style: AppStyle.md.copyWith(color: Colors.grey.shade600),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [AppColor.primary, AppColor.primary.withOpacity(0.8)],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColor.primary.withOpacity(0.3),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
'${order.payments.length} Pembayaran',
|
||||
style: AppStyle.sm.copyWith(
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,7 @@ class PaymentPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
(data) {
|
||||
if (context.mounted) {
|
||||
context.router.replace(
|
||||
PaymentSuccessRoute(orderId: order.id),
|
||||
PaymentSuccessSplitBillRoute(orderId: order.id),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
@ -228,6 +228,7 @@ class _PaymentRightPanelState extends State<PaymentRightPanel> {
|
||||
PaymentFormEvent.submittedSplitBill(
|
||||
customerId: widget.customerId,
|
||||
splitType: widget.splitType,
|
||||
customerName: widget.customerName,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
|
||||
@ -480,7 +480,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
selectedCustomer: widget.state.customer,
|
||||
onSelected: (customer) {
|
||||
context.read<SplitBillFormBloc>().add(
|
||||
SplitBillFormEvent.customerChanged(customer!),
|
||||
SplitBillFormEvent.customerChanged(customer),
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -488,7 +488,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
}
|
||||
|
||||
void _confirmSplit() {
|
||||
if (widget.state.customerName == '' || widget.state.customer == null) {
|
||||
if (widget.state.customerName == '') {
|
||||
AppFlushbar.showError(context, 'Nama Pelanggan harus diisi');
|
||||
|
||||
return;
|
||||
@ -519,6 +519,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
isSplit: true,
|
||||
splitType: widget.state.splitType,
|
||||
customerId: widget.state.customer?.id,
|
||||
customerName: widget.state.customerName,
|
||||
order: widget.state.order.copyWith(
|
||||
orderItems: splitItems,
|
||||
subtotal: splitTotal,
|
||||
@ -540,6 +541,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
isSplit: true,
|
||||
splitType: widget.state.splitType,
|
||||
customerId: widget.state.customer?.id,
|
||||
customerName: widget.state.customerName,
|
||||
order: widget.state.order.copyWith(
|
||||
subtotal: widget.state.totalAmount,
|
||||
totalAmount: widget.state.totalAmount,
|
||||
|
||||
@ -37,6 +37,7 @@ class AppRouter extends RootStackRouter {
|
||||
// Payment
|
||||
AutoRoute(page: PaymentRoute.page),
|
||||
AutoRoute(page: PaymentSuccessRoute.page),
|
||||
AutoRoute(page: PaymentSuccessSplitBillRoute.page),
|
||||
|
||||
// Void
|
||||
AutoRoute(page: VoidRoute.page),
|
||||
|
||||
@ -9,8 +9,8 @@
|
||||
// coverage:ignore-file
|
||||
|
||||
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||
import 'package:apskel_pos_flutter_v2/common/types/split_type.dart' as _i22;
|
||||
import 'package:apskel_pos_flutter_v2/domain/order/order.dart' as _i21;
|
||||
import 'package:apskel_pos_flutter_v2/common/types/split_type.dart' as _i23;
|
||||
import 'package:apskel_pos_flutter_v2/domain/order/order.dart' as _i22;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/auth/login/login_page.dart'
|
||||
as _i4;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/checkout/checkout_page.dart'
|
||||
@ -22,107 +22,109 @@ import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/customer/cus
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/home/home_page.dart'
|
||||
as _i3;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/report/report_page.dart'
|
||||
as _i9;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/setting/setting_page.dart'
|
||||
as _i10;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/setting/setting_page.dart'
|
||||
as _i11;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/main/pages/table/table_page.dart'
|
||||
as _i16;
|
||||
as _i17;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/order/order_page.dart'
|
||||
as _i6;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/order/pages/success_add_item_order/success_add_item_order_page.dart'
|
||||
as _i13;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/order/pages/success_order/success_order_page.dart'
|
||||
as _i14;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/order/pages/success_order/success_order_page.dart'
|
||||
as _i15;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/payment/pages/payment_success/payment_success_page.dart'
|
||||
as _i8;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/payment/pages/payment_success_split_bill/payment_success_split_bill_page.dart'
|
||||
as _i9;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/payment/payment_page.dart'
|
||||
as _i7;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/splash/splash_page.dart'
|
||||
as _i11;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/split_bill/split_bill_page.dart'
|
||||
as _i12;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/split_bill/split_bill_page.dart'
|
||||
as _i13;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/sync/sync_page.dart'
|
||||
as _i15;
|
||||
as _i16;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/void/pages/void_success/void_success_page.dart'
|
||||
as _i18;
|
||||
as _i19;
|
||||
import 'package:apskel_pos_flutter_v2/presentation/pages/void/void_page.dart'
|
||||
as _i17;
|
||||
import 'package:auto_route/auto_route.dart' as _i19;
|
||||
import 'package:flutter/material.dart' as _i20;
|
||||
as _i18;
|
||||
import 'package:auto_route/auto_route.dart' as _i20;
|
||||
import 'package:flutter/material.dart' as _i21;
|
||||
|
||||
/// generated route for
|
||||
/// [_i1.CheckoutPage]
|
||||
class CheckoutRoute extends _i19.PageRouteInfo<void> {
|
||||
const CheckoutRoute({List<_i19.PageRouteInfo>? children})
|
||||
class CheckoutRoute extends _i20.PageRouteInfo<void> {
|
||||
const CheckoutRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(CheckoutRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'CheckoutRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i1.CheckoutPage());
|
||||
return _i20.WrappedRoute(child: const _i1.CheckoutPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i2.CustomerPage]
|
||||
class CustomerRoute extends _i19.PageRouteInfo<void> {
|
||||
const CustomerRoute({List<_i19.PageRouteInfo>? children})
|
||||
class CustomerRoute extends _i20.PageRouteInfo<void> {
|
||||
const CustomerRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(CustomerRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'CustomerRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i2.CustomerPage());
|
||||
return _i20.WrappedRoute(child: const _i2.CustomerPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i3.HomePage]
|
||||
class HomeRoute extends _i19.PageRouteInfo<void> {
|
||||
const HomeRoute({List<_i19.PageRouteInfo>? children})
|
||||
class HomeRoute extends _i20.PageRouteInfo<void> {
|
||||
const HomeRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(HomeRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'HomeRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i3.HomePage());
|
||||
return _i20.WrappedRoute(child: const _i3.HomePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i4.LoginPage]
|
||||
class LoginRoute extends _i19.PageRouteInfo<void> {
|
||||
const LoginRoute({List<_i19.PageRouteInfo>? children})
|
||||
class LoginRoute extends _i20.PageRouteInfo<void> {
|
||||
const LoginRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(LoginRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'LoginRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i4.LoginPage());
|
||||
return _i20.WrappedRoute(child: const _i4.LoginPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i5.MainPage]
|
||||
class MainRoute extends _i19.PageRouteInfo<void> {
|
||||
const MainRoute({List<_i19.PageRouteInfo>? children})
|
||||
class MainRoute extends _i20.PageRouteInfo<void> {
|
||||
const MainRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(MainRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'MainRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i5.MainPage();
|
||||
@ -132,11 +134,11 @@ class MainRoute extends _i19.PageRouteInfo<void> {
|
||||
|
||||
/// generated route for
|
||||
/// [_i6.OrderPage]
|
||||
class OrderRoute extends _i19.PageRouteInfo<OrderRouteArgs> {
|
||||
class OrderRoute extends _i20.PageRouteInfo<OrderRouteArgs> {
|
||||
OrderRoute({
|
||||
_i20.Key? key,
|
||||
_i21.Key? key,
|
||||
required String status,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
OrderRoute.name,
|
||||
args: OrderRouteArgs(key: key, status: status),
|
||||
@ -145,11 +147,11 @@ class OrderRoute extends _i19.PageRouteInfo<OrderRouteArgs> {
|
||||
|
||||
static const String name = 'OrderRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<OrderRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
return _i20.WrappedRoute(
|
||||
child: _i6.OrderPage(key: args.key, status: args.status),
|
||||
);
|
||||
},
|
||||
@ -159,7 +161,7 @@ class OrderRoute extends _i19.PageRouteInfo<OrderRouteArgs> {
|
||||
class OrderRouteArgs {
|
||||
const OrderRouteArgs({this.key, required this.status});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final String status;
|
||||
|
||||
@ -171,15 +173,15 @@ class OrderRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i7.PaymentPage]
|
||||
class PaymentRoute extends _i19.PageRouteInfo<PaymentRouteArgs> {
|
||||
class PaymentRoute extends _i20.PageRouteInfo<PaymentRouteArgs> {
|
||||
PaymentRoute({
|
||||
_i20.Key? key,
|
||||
required _i21.Order order,
|
||||
_i21.Key? key,
|
||||
required _i22.Order order,
|
||||
bool isSplit = false,
|
||||
_i22.SplitType splitType = _i22.SplitType.unknown,
|
||||
_i23.SplitType splitType = _i23.SplitType.unknown,
|
||||
String? customerId,
|
||||
String? customerName,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
PaymentRoute.name,
|
||||
args: PaymentRouteArgs(
|
||||
@ -195,11 +197,11 @@ class PaymentRoute extends _i19.PageRouteInfo<PaymentRouteArgs> {
|
||||
|
||||
static const String name = 'PaymentRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<PaymentRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
return _i20.WrappedRoute(
|
||||
child: _i7.PaymentPage(
|
||||
key: args.key,
|
||||
order: args.order,
|
||||
@ -218,18 +220,18 @@ class PaymentRouteArgs {
|
||||
this.key,
|
||||
required this.order,
|
||||
this.isSplit = false,
|
||||
this.splitType = _i22.SplitType.unknown,
|
||||
this.splitType = _i23.SplitType.unknown,
|
||||
this.customerId,
|
||||
this.customerName,
|
||||
});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final _i21.Order order;
|
||||
final _i22.Order order;
|
||||
|
||||
final bool isSplit;
|
||||
|
||||
final _i22.SplitType splitType;
|
||||
final _i23.SplitType splitType;
|
||||
|
||||
final String? customerId;
|
||||
|
||||
@ -243,11 +245,11 @@ class PaymentRouteArgs {
|
||||
|
||||
/// generated route for
|
||||
/// [_i8.PaymentSuccessPage]
|
||||
class PaymentSuccessRoute extends _i19.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
class PaymentSuccessRoute extends _i20.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
PaymentSuccessRoute({
|
||||
_i20.Key? key,
|
||||
_i21.Key? key,
|
||||
required String orderId,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
PaymentSuccessRoute.name,
|
||||
args: PaymentSuccessRouteArgs(key: key, orderId: orderId),
|
||||
@ -256,11 +258,11 @@ class PaymentSuccessRoute extends _i19.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
|
||||
static const String name = 'PaymentSuccessRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<PaymentSuccessRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
return _i20.WrappedRoute(
|
||||
child: _i8.PaymentSuccessPage(key: args.key, orderId: args.orderId),
|
||||
);
|
||||
},
|
||||
@ -270,7 +272,7 @@ class PaymentSuccessRoute extends _i19.PageRouteInfo<PaymentSuccessRouteArgs> {
|
||||
class PaymentSuccessRouteArgs {
|
||||
const PaymentSuccessRouteArgs({this.key, required this.orderId});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final String orderId;
|
||||
|
||||
@ -281,60 +283,103 @@ class PaymentSuccessRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i9.ReportPage]
|
||||
class ReportRoute extends _i19.PageRouteInfo<void> {
|
||||
const ReportRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i9.PaymentSuccessSplitBillPage]
|
||||
class PaymentSuccessSplitBillRoute
|
||||
extends _i20.PageRouteInfo<PaymentSuccessSplitBillRouteArgs> {
|
||||
PaymentSuccessSplitBillRoute({
|
||||
_i21.Key? key,
|
||||
required String orderId,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
PaymentSuccessSplitBillRoute.name,
|
||||
args: PaymentSuccessSplitBillRouteArgs(key: key, orderId: orderId),
|
||||
initialChildren: children,
|
||||
);
|
||||
|
||||
static const String name = 'PaymentSuccessSplitBillRoute';
|
||||
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<PaymentSuccessSplitBillRouteArgs>();
|
||||
return _i20.WrappedRoute(
|
||||
child: _i9.PaymentSuccessSplitBillPage(
|
||||
key: args.key,
|
||||
orderId: args.orderId,
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
class PaymentSuccessSplitBillRouteArgs {
|
||||
const PaymentSuccessSplitBillRouteArgs({this.key, required this.orderId});
|
||||
|
||||
final _i21.Key? key;
|
||||
|
||||
final String orderId;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'PaymentSuccessSplitBillRouteArgs{key: $key, orderId: $orderId}';
|
||||
}
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i10.ReportPage]
|
||||
class ReportRoute extends _i20.PageRouteInfo<void> {
|
||||
const ReportRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(ReportRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'ReportRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i9.ReportPage();
|
||||
return const _i10.ReportPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i10.SettingPage]
|
||||
class SettingRoute extends _i19.PageRouteInfo<void> {
|
||||
const SettingRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i11.SettingPage]
|
||||
class SettingRoute extends _i20.PageRouteInfo<void> {
|
||||
const SettingRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(SettingRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SettingRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i10.SettingPage();
|
||||
return const _i11.SettingPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i11.SplashPage]
|
||||
class SplashRoute extends _i19.PageRouteInfo<void> {
|
||||
const SplashRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i12.SplashPage]
|
||||
class SplashRoute extends _i20.PageRouteInfo<void> {
|
||||
const SplashRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(SplashRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SplashRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i11.SplashPage();
|
||||
return const _i12.SplashPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i12.SplitBillPage]
|
||||
class SplitBillRoute extends _i19.PageRouteInfo<SplitBillRouteArgs> {
|
||||
/// [_i13.SplitBillPage]
|
||||
class SplitBillRoute extends _i20.PageRouteInfo<SplitBillRouteArgs> {
|
||||
SplitBillRoute({
|
||||
_i20.Key? key,
|
||||
required _i21.Order order,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
_i21.Key? key,
|
||||
required _i22.Order order,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
SplitBillRoute.name,
|
||||
args: SplitBillRouteArgs(key: key, order: order),
|
||||
@ -343,12 +388,12 @@ class SplitBillRoute extends _i19.PageRouteInfo<SplitBillRouteArgs> {
|
||||
|
||||
static const String name = 'SplitBillRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<SplitBillRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
child: _i12.SplitBillPage(key: args.key, order: args.order),
|
||||
return _i20.WrappedRoute(
|
||||
child: _i13.SplitBillPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
);
|
||||
@ -357,9 +402,9 @@ class SplitBillRoute extends _i19.PageRouteInfo<SplitBillRouteArgs> {
|
||||
class SplitBillRouteArgs {
|
||||
const SplitBillRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final _i21.Order order;
|
||||
final _i22.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -368,28 +413,28 @@ class SplitBillRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i13.SuccessAddItemOrderPage]
|
||||
class SuccessAddItemOrderRoute extends _i19.PageRouteInfo<void> {
|
||||
const SuccessAddItemOrderRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i14.SuccessAddItemOrderPage]
|
||||
class SuccessAddItemOrderRoute extends _i20.PageRouteInfo<void> {
|
||||
const SuccessAddItemOrderRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(SuccessAddItemOrderRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SuccessAddItemOrderRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i13.SuccessAddItemOrderPage();
|
||||
return const _i14.SuccessAddItemOrderPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i14.SuccessOrderPage]
|
||||
class SuccessOrderRoute extends _i19.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
/// [_i15.SuccessOrderPage]
|
||||
class SuccessOrderRoute extends _i20.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
SuccessOrderRoute({
|
||||
_i20.Key? key,
|
||||
required _i21.Order order,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
_i21.Key? key,
|
||||
required _i22.Order order,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
SuccessOrderRoute.name,
|
||||
args: SuccessOrderRouteArgs(key: key, order: order),
|
||||
@ -398,12 +443,12 @@ class SuccessOrderRoute extends _i19.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
|
||||
static const String name = 'SuccessOrderRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<SuccessOrderRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
child: _i14.SuccessOrderPage(key: args.key, order: args.order),
|
||||
return _i20.WrappedRoute(
|
||||
child: _i15.SuccessOrderPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
);
|
||||
@ -412,9 +457,9 @@ class SuccessOrderRoute extends _i19.PageRouteInfo<SuccessOrderRouteArgs> {
|
||||
class SuccessOrderRouteArgs {
|
||||
const SuccessOrderRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final _i21.Order order;
|
||||
final _i22.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -423,44 +468,44 @@ class SuccessOrderRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i15.SyncPage]
|
||||
class SyncRoute extends _i19.PageRouteInfo<void> {
|
||||
const SyncRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i16.SyncPage]
|
||||
class SyncRoute extends _i20.PageRouteInfo<void> {
|
||||
const SyncRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(SyncRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'SyncRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i15.SyncPage());
|
||||
return _i20.WrappedRoute(child: const _i16.SyncPage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i16.TablePage]
|
||||
class TableRoute extends _i19.PageRouteInfo<void> {
|
||||
const TableRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i17.TablePage]
|
||||
class TableRoute extends _i20.PageRouteInfo<void> {
|
||||
const TableRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(TableRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'TableRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return _i19.WrappedRoute(child: const _i16.TablePage());
|
||||
return _i20.WrappedRoute(child: const _i17.TablePage());
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i17.VoidPage]
|
||||
class VoidRoute extends _i19.PageRouteInfo<VoidRouteArgs> {
|
||||
/// [_i18.VoidPage]
|
||||
class VoidRoute extends _i20.PageRouteInfo<VoidRouteArgs> {
|
||||
VoidRoute({
|
||||
_i20.Key? key,
|
||||
required _i21.Order order,
|
||||
List<_i19.PageRouteInfo>? children,
|
||||
_i21.Key? key,
|
||||
required _i22.Order order,
|
||||
List<_i20.PageRouteInfo>? children,
|
||||
}) : super(
|
||||
VoidRoute.name,
|
||||
args: VoidRouteArgs(key: key, order: order),
|
||||
@ -469,12 +514,12 @@ class VoidRoute extends _i19.PageRouteInfo<VoidRouteArgs> {
|
||||
|
||||
static const String name = 'VoidRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
final args = data.argsAs<VoidRouteArgs>();
|
||||
return _i19.WrappedRoute(
|
||||
child: _i17.VoidPage(key: args.key, order: args.order),
|
||||
return _i20.WrappedRoute(
|
||||
child: _i18.VoidPage(key: args.key, order: args.order),
|
||||
);
|
||||
},
|
||||
);
|
||||
@ -483,9 +528,9 @@ class VoidRoute extends _i19.PageRouteInfo<VoidRouteArgs> {
|
||||
class VoidRouteArgs {
|
||||
const VoidRouteArgs({this.key, required this.order});
|
||||
|
||||
final _i20.Key? key;
|
||||
final _i21.Key? key;
|
||||
|
||||
final _i21.Order order;
|
||||
final _i22.Order order;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@ -494,17 +539,17 @@ class VoidRouteArgs {
|
||||
}
|
||||
|
||||
/// generated route for
|
||||
/// [_i18.VoidSuccessPage]
|
||||
class VoidSuccessRoute extends _i19.PageRouteInfo<void> {
|
||||
const VoidSuccessRoute({List<_i19.PageRouteInfo>? children})
|
||||
/// [_i19.VoidSuccessPage]
|
||||
class VoidSuccessRoute extends _i20.PageRouteInfo<void> {
|
||||
const VoidSuccessRoute({List<_i20.PageRouteInfo>? children})
|
||||
: super(VoidSuccessRoute.name, initialChildren: children);
|
||||
|
||||
static const String name = 'VoidSuccessRoute';
|
||||
|
||||
static _i19.PageInfo page = _i19.PageInfo(
|
||||
static _i20.PageInfo page = _i20.PageInfo(
|
||||
name,
|
||||
builder: (data) {
|
||||
return const _i18.VoidSuccessPage();
|
||||
return const _i19.VoidSuccessPage();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user