const constructure
This commit is contained in:
@@ -16,24 +16,24 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(color: AppColor.white),
|
||||
decoration: const BoxDecoration(color: AppColor.white),
|
||||
child: Column(
|
||||
children: [
|
||||
PageTitle(
|
||||
title: 'Ringkasan Pesanan',
|
||||
subtitle: state.order.orderNumber,
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Expanded(
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.symmetric(horizontal: 16),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 16),
|
||||
itemCount: state.pendingItems.length,
|
||||
itemBuilder: (context, index) {
|
||||
return _buildOrderItem(state.pendingItems[index]);
|
||||
},
|
||||
),
|
||||
),
|
||||
DashedDivider(color: AppColor.border),
|
||||
const DashedDivider(color: AppColor.border),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
@@ -54,7 +54,7 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
title: 'Diskon',
|
||||
value: state.order.discountAmount.currencyFormatRpV2,
|
||||
),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
],
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -75,7 +75,7 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -95,7 +95,7 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(6),
|
||||
const SpaceHeight(6),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -135,7 +135,7 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
|
||||
Widget _buildOrderItem(OrderItem item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(vertical: 12),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@@ -178,7 +178,7 @@ class SplitBillLeftPanel extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
if ((item.paidQuantity) > 1) ...[
|
||||
SpaceHeight(6),
|
||||
const SpaceHeight(6),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Container(
|
||||
|
||||
@@ -47,7 +47,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -58,17 +58,17 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
_buildCustomer(context),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
_buildRowButtonSplit(),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
Container(
|
||||
child: widget.state.splitType.isItem
|
||||
? _buildPerProductSplit()
|
||||
: _buildPerAmountSplit(),
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -81,7 +81,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
Widget _buildBottom() {
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(color: AppColor.white),
|
||||
decoration: const BoxDecoration(color: AppColor.white),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -90,7 +90,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
label: 'Batal',
|
||||
),
|
||||
),
|
||||
SpaceWidth(16),
|
||||
const SpaceWidth(16),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: () => _confirmSplit(),
|
||||
@@ -113,11 +113,11 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border.all(color: AppColor.border),
|
||||
@@ -133,12 +133,12 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Text(
|
||||
'Jumlah yang akan dibayar:',
|
||||
style: AppStyle.md.copyWith(color: AppColor.textSecondary),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColor.border),
|
||||
@@ -169,11 +169,11 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
contentPadding: const EdgeInsets.all(16),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -193,7 +193,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
const SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
@@ -233,9 +233,9 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.textPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
border: Border.all(color: AppColor.border),
|
||||
@@ -251,11 +251,11 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
const SizedBox(height: 16),
|
||||
ListView.builder(
|
||||
itemCount: widget.state.pendingItems.length,
|
||||
shrinkWrap: true,
|
||||
physics: NeverScrollableScrollPhysics(),
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildProductSplitItem(
|
||||
widget.state.pendingItems[index],
|
||||
@@ -266,7 +266,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
width: double.infinity,
|
||||
height: 1,
|
||||
color: AppColor.border,
|
||||
margin: EdgeInsets.symmetric(vertical: 12),
|
||||
margin: const EdgeInsets.symmetric(vertical: 12),
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -299,8 +299,8 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
int maxQty = (item.quantity) - (item.paidQuantity);
|
||||
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
padding: EdgeInsets.all(12),
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: selectedQty > 0
|
||||
? AppColor.primary.withOpacity(0.1)
|
||||
@@ -372,7 +372,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
Container(
|
||||
width: 40,
|
||||
height: 32,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8),
|
||||
margin: const EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColor.border),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
@@ -431,7 +431,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
return Row(
|
||||
children: [
|
||||
_buildSplitTypeButton('Per Produk', SplitType.item),
|
||||
SizedBox(width: 16),
|
||||
const SizedBox(width: 16),
|
||||
_buildSplitTypeButton('Per Jumlah', SplitType.amount),
|
||||
],
|
||||
);
|
||||
@@ -448,7 +448,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24, vertical: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.primary : Colors.transparent,
|
||||
border: Border.all(
|
||||
@@ -470,7 +470,7 @@ class _SplitBillRightPanelState extends State<SplitBillRightPanel> {
|
||||
|
||||
Widget _buildCustomer(BuildContext context) {
|
||||
return Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.white,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
|
||||
Reference in New Issue
Block a user