const constructure
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import 'package:auto_route/auto_route.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
import '../../../application/order/order_loader/order_loader_bloc.dart';
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ class SuccessAddItemOrderPage extends StatelessWidget {
|
||||
checkoutState: checkoutState,
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
flex: 65,
|
||||
child: SuccessAddItemOrderRightPanel(
|
||||
|
||||
+5
-5
@@ -72,7 +72,7 @@ class SuccessAddItemOrderLeftPanel extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Text(
|
||||
'Pesanan Berhasil!',
|
||||
style: AppStyle.h4.copyWith(
|
||||
@@ -80,7 +80,7 @@ class SuccessAddItemOrderLeftPanel extends StatelessWidget {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
Text(
|
||||
'Pesanan telah diterima dan\nsedang diproses',
|
||||
style: AppStyle.md.copyWith(
|
||||
@@ -103,7 +103,7 @@ class SuccessAddItemOrderLeftPanel extends StatelessWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
@@ -177,7 +177,7 @@ class SuccessAddItemOrderLeftPanel extends StatelessWidget {
|
||||
child: AppElevatedButton.outlined(
|
||||
onPressed: () {
|
||||
context.read<CheckoutFormBloc>().add(
|
||||
CheckoutFormEvent.started([]),
|
||||
const CheckoutFormEvent.started([]),
|
||||
);
|
||||
context.router.replaceAll([const MainRoute()]);
|
||||
},
|
||||
@@ -198,7 +198,7 @@ class SuccessAddItemOrderLeftPanel 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 SuccessAddItemOrderRightPanel extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.shopping_cart_outlined,
|
||||
size: 16,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -130,13 +130,13 @@ class SuccessAddItemOrderRightPanel 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),
|
||||
@@ -207,7 +207,7 @@ class SuccessAddItemOrderRightPanel 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,
|
||||
@@ -300,9 +300,9 @@ class SuccessAddItemOrderRightPanel 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: [
|
||||
@@ -317,13 +317,13 @@ class SuccessAddItemOrderRightPanel 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,
|
||||
@@ -332,7 +332,7 @@ class SuccessAddItemOrderRightPanel 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),
|
||||
|
||||
@@ -51,7 +51,7 @@ class SuccessOrderPage extends StatelessWidget implements AutoRouteWrapper {
|
||||
flex: 35,
|
||||
child: SuccessOrderLeftPanel(order: state.order),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
flex: 65,
|
||||
child: SuccessOrderRightPanel(order: state.order),
|
||||
|
||||
+4
-4
@@ -71,7 +71,7 @@ class SuccessOrderLeftPanel extends StatelessWidget {
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Text(
|
||||
'Pesanan Berhasil!',
|
||||
style: AppStyle.h4.copyWith(
|
||||
@@ -79,7 +79,7 @@ class SuccessOrderLeftPanel extends StatelessWidget {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
Text(
|
||||
'Pesanan telah diterima dan\nsedang diproses',
|
||||
style: AppStyle.md.copyWith(
|
||||
@@ -102,7 +102,7 @@ class SuccessOrderLeftPanel extends StatelessWidget {
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
_buildInfoRow(
|
||||
icon: Icons.person,
|
||||
label: 'Pemesan',
|
||||
@@ -176,7 +176,7 @@ class SuccessOrderLeftPanel 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 SuccessOrderRightPanel extends StatelessWidget {
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.shopping_cart_outlined,
|
||||
size: 16,
|
||||
color: AppColor.textSecondary,
|
||||
@@ -123,13 +123,13 @@ class SuccessOrderRightPanel 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 SuccessOrderRightPanel 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 SuccessOrderRightPanel 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 SuccessOrderRightPanel 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 SuccessOrderRightPanel 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),
|
||||
|
||||
@@ -86,7 +86,7 @@ class OrderInformation extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
(order?.status ?? "").toUpperCase(),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -102,7 +102,7 @@ class OrderInformation extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
(order?.status ?? "").toUpperCase(),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -118,7 +118,7 @@ class OrderInformation extends StatelessWidget {
|
||||
),
|
||||
child: Text(
|
||||
(order?.status ?? "").toUpperCase(),
|
||||
style: TextStyle(
|
||||
style: const TextStyle(
|
||||
color: Colors.white,
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
|
||||
@@ -59,7 +59,7 @@ class _OrderLeftPanelState extends State<OrderLeftPanel> {
|
||||
child: widget.state.failureOption.fold(
|
||||
() {
|
||||
if (widget.state.isFetching) {
|
||||
return Center(child: LoaderWithText());
|
||||
return const Center(child: LoaderWithText());
|
||||
}
|
||||
|
||||
if (widget.state.orders.isEmpty) {
|
||||
|
||||
@@ -87,7 +87,7 @@ class OrderList extends StatelessWidget {
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.shopping_cart_outlined,
|
||||
size: 16,
|
||||
color: AppColor.primary,
|
||||
@@ -248,7 +248,7 @@ class OrderList extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
if (order?.splitType == 'ITEM' && order?.status == 'pending') ...[
|
||||
SpaceHeight(6),
|
||||
const SpaceHeight(6),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Container(
|
||||
|
||||
@@ -55,7 +55,7 @@ class OrderListPayment extends StatelessWidget {
|
||||
),
|
||||
Text(
|
||||
(order?.totalPaid ?? 0).currencyFormatRpV2,
|
||||
style: TextStyle(fontWeight: FontWeight.w500),
|
||||
style: const TextStyle(fontWeight: FontWeight.w500),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -53,8 +53,8 @@ class OrderRightPanel extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: AppColor.white),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(color: AppColor.white),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
@@ -71,9 +71,9 @@ class OrderRightPanel extends StatelessWidget {
|
||||
}
|
||||
},
|
||||
label: 'Print Bill',
|
||||
icon: Icon(Icons.print),
|
||||
icon: const Icon(Icons.print),
|
||||
),
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
if (state.selectedOrder?.status == 'completed')
|
||||
if (state.selectedOrder?.isRefund == false)
|
||||
AppElevatedButton.outlined(
|
||||
@@ -83,7 +83,7 @@ class OrderRightPanel extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
label: 'Refund',
|
||||
icon: Icon(Icons.autorenew),
|
||||
icon: const Icon(Icons.autorenew),
|
||||
),
|
||||
if (state.selectedOrder?.status == 'pending') ...[
|
||||
AppElevatedButton.outlined(
|
||||
@@ -91,9 +91,9 @@ class OrderRightPanel extends StatelessWidget {
|
||||
VoidRoute(order: state.selectedOrder!),
|
||||
),
|
||||
label: 'Void',
|
||||
icon: Icon(Icons.undo),
|
||||
icon: const Icon(Icons.undo),
|
||||
),
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
AppElevatedButton.outlined(
|
||||
onPressed: () {
|
||||
context.router.push(
|
||||
@@ -101,10 +101,10 @@ class OrderRightPanel extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
label: 'Split Bill',
|
||||
icon: Icon(Icons.calculate_outlined),
|
||||
icon: const Icon(Icons.calculate_outlined),
|
||||
),
|
||||
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
if (state.selectedOrder?.paymentStatus != 'partial')
|
||||
AppElevatedButton.filled(
|
||||
width: 120,
|
||||
@@ -114,7 +114,7 @@ class OrderRightPanel extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
label: 'Bayar',
|
||||
icon: Icon(Icons.payment, color: Colors.white),
|
||||
icon: const Icon(Icons.payment, color: Colors.white),
|
||||
),
|
||||
],
|
||||
],
|
||||
|
||||
@@ -30,7 +30,7 @@ class OrderTitle extends StatelessWidget {
|
||||
title: title,
|
||||
bottom: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12.0),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border(
|
||||
bottom: BorderSide(color: AppColor.border, width: 1.0),
|
||||
@@ -53,7 +53,7 @@ class OrderTitle extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -63,7 +63,7 @@ class OrderTitle extends StatelessWidget {
|
||||
showLabel: false,
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
GestureDetector(
|
||||
onTap: () => DateRangePickerModal.show(
|
||||
context: context,
|
||||
@@ -78,7 +78,7 @@ class OrderTitle extends StatelessWidget {
|
||||
color: AppColor.primary,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Icon(
|
||||
child: const Icon(
|
||||
Icons.filter_list_outlined,
|
||||
color: AppColor.white,
|
||||
size: 24,
|
||||
|
||||
Reference in New Issue
Block a user