const constructure
This commit is contained in:
+3
-3
@@ -71,7 +71,7 @@ class PaymentSuccessLeftPanel extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Text(
|
||||
'Pembayaran Berhasil!',
|
||||
style: AppStyle.h4.copyWith(
|
||||
@@ -93,7 +93,7 @@ class PaymentSuccessLeftPanel extends StatelessWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
@@ -167,7 +167,7 @@ class PaymentSuccessLeftPanel extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
label: 'Cetak Struk',
|
||||
icon: Icon(Icons.print_rounded, color: AppColor.white),
|
||||
icon: const Icon(Icons.print_rounded, color: AppColor.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
+9
-9
@@ -70,7 +70,7 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.shopping_cart_outlined,
|
||||
size: 16,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -123,13 +123,13 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
color: AppColor.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.payments_rounded,
|
||||
size: 16,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||
@@ -192,7 +192,7 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
color: AppColor.primaryWithOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.restaurant_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 28,
|
||||
@@ -281,9 +281,9 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: AppColor.border)),
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -298,13 +298,13 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.receipt_long_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -313,7 +313,7 @@ class PaymentSuccessRightPanel extends StatelessWidget {
|
||||
'Detail Pesanan',
|
||||
style: AppStyle.xxl.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
'Ringkasan item yang dipesan',
|
||||
style: AppStyle.md.copyWith(color: Colors.grey.shade600),
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ class PaymentSuccessSplitBillLeftPanel extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
Text(
|
||||
'Pembayaran Berhasil!',
|
||||
style: AppStyle.h4.copyWith(
|
||||
@@ -93,7 +93,7 @@ class PaymentSuccessSplitBillLeftPanel extends StatelessWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
@@ -173,7 +173,7 @@ class PaymentSuccessSplitBillLeftPanel extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
label: 'Cetak Struk',
|
||||
icon: Icon(Icons.print_rounded, color: AppColor.white),
|
||||
icon: const Icon(Icons.print_rounded, color: AppColor.white),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
+9
-9
@@ -104,7 +104,7 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
),
|
||||
|
||||
const SpaceHeight(8),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8),
|
||||
|
||||
Row(
|
||||
@@ -158,13 +158,13 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
color: AppColor.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.payments_rounded,
|
||||
size: 16,
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Text(
|
||||
'Total Pembayaran',
|
||||
style: AppStyle.lg.copyWith(fontWeight: FontWeight.bold),
|
||||
@@ -224,7 +224,7 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
color: AppColor.primary.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Icon(Icons.payments, color: AppColor.primary, size: 16),
|
||||
child: const Icon(Icons.payments, color: AppColor.primary, size: 16),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
@@ -258,9 +258,9 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(bottom: BorderSide(color: AppColor.border)),
|
||||
borderRadius: const BorderRadius.vertical(top: Radius.circular(24)),
|
||||
borderRadius: BorderRadius.vertical(top: Radius.circular(24)),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -275,13 +275,13 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.receipt_long_rounded,
|
||||
color: AppColor.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -290,7 +290,7 @@ class PaymentSuccessSplitBillRightPanel extends StatelessWidget {
|
||||
'Daftar Split Bill',
|
||||
style: AppStyle.xxl.copyWith(fontWeight: FontWeight.bold),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Text(
|
||||
'Ringkasan split bill',
|
||||
style: AppStyle.md.copyWith(color: Colors.grey.shade600),
|
||||
|
||||
@@ -83,13 +83,13 @@ class PaymentPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
),
|
||||
leading: IconButton(
|
||||
onPressed: () => context.router.maybePop(),
|
||||
icon: Icon(Icons.arrow_back, color: AppColor.primary),
|
||||
icon: const Icon(Icons.arrow_back, color: AppColor.primary),
|
||||
),
|
||||
actions: [
|
||||
if (isSplit)
|
||||
Container(
|
||||
padding: EdgeInsets.all(4),
|
||||
margin: EdgeInsets.only(right: 8),
|
||||
padding: const EdgeInsets.all(4),
|
||||
margin: const EdgeInsets.only(right: 8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColor.primary),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
@@ -167,7 +167,7 @@ class PaymentPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
BlocProvider(
|
||||
create: (context) =>
|
||||
getIt<PaymentMethodLoaderBloc>()
|
||||
..add(PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
||||
..add(const PaymentMethodLoaderEvent.fetched(isRefresh: true)),
|
||||
),
|
||||
],
|
||||
child: this,
|
||||
|
||||
@@ -42,9 +42,9 @@ class PaymentLeftPanel extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(8),
|
||||
Divider(color: AppColor.border),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
const Divider(color: AppColor.border),
|
||||
const SpaceHeight(8),
|
||||
Expanded(
|
||||
child: state.pendingItems.isEmpty
|
||||
? const Center(child: Text('Tidak ada item'))
|
||||
@@ -52,7 +52,7 @@ class PaymentLeftPanel extends StatelessWidget {
|
||||
shrinkWrap: true,
|
||||
itemCount: state.pendingItems.length,
|
||||
separatorBuilder: (_, __) =>
|
||||
Divider(color: AppColor.border),
|
||||
const Divider(color: AppColor.border),
|
||||
itemBuilder: (context, index) {
|
||||
final item = state.pendingItems[index];
|
||||
return ListTile(
|
||||
@@ -79,13 +79,13 @@ class PaymentLeftPanel extends StatelessWidget {
|
||||
},
|
||||
),
|
||||
),
|
||||
Divider(color: AppColor.border),
|
||||
const Divider(color: AppColor.border),
|
||||
_buildSummaryRow('Subtotal', state.order.subtotal),
|
||||
_buildSummaryRow('Pajak', state.order.taxAmount),
|
||||
_buildSummaryRow('Diskon', state.order.discountAmount),
|
||||
SpaceHeight(8),
|
||||
DashedDivider(color: AppColor.border),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
const SpaceHeight(8),
|
||||
_buildSummaryRow(
|
||||
'Total',
|
||||
state.order.totalAmount,
|
||||
|
||||
@@ -65,7 +65,7 @@ class _PaymentRightPanelState extends State<PaymentRightPanel> {
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -81,19 +81,19 @@ class _PaymentRightPanelState extends State<PaymentRightPanel> {
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
Text(
|
||||
'Metode Pembayaran',
|
||||
style: AppStyle.md.copyWith(fontWeight: FontWeight.w600),
|
||||
),
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
BlocBuilder<
|
||||
PaymentMethodLoaderBloc,
|
||||
PaymentMethodLoaderState
|
||||
>(
|
||||
builder: (context, pmState) {
|
||||
if (pmState.isFetching) {
|
||||
return Center(child: LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
return pmState.failureOption.fold(
|
||||
() => Wrap(
|
||||
@@ -129,7 +129,7 @@ class _PaymentRightPanelState extends State<PaymentRightPanel> {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
if (widget.state.paymentMethod != null &&
|
||||
widget.state.paymentMethod!.type == 'cash')
|
||||
Column(
|
||||
@@ -233,7 +233,7 @@ class _PaymentRightPanelState extends State<PaymentRightPanel> {
|
||||
);
|
||||
} else {
|
||||
context.read<PaymentFormBloc>().add(
|
||||
PaymentFormEvent.submitted(),
|
||||
const PaymentFormEvent.submitted(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user