feat: order response model
This commit is contained in:
@@ -63,27 +63,6 @@ class SalesListOrder extends StatelessWidget {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: isAllSelected ? AppColors.primary : Colors.grey.shade300,
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: Checkbox(
|
||||
value: isAllSelected,
|
||||
activeColor: AppColors.primary,
|
||||
checkColor: AppColors.white,
|
||||
onChanged: (val) {
|
||||
context
|
||||
.read<OrderFormBloc>()
|
||||
.add(OrderFormEvent.toggleSelectAll(val ?? false));
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -179,28 +158,6 @@ class SalesListOrder extends StatelessWidget {
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.white,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
border: Border.all(
|
||||
color:
|
||||
isSelected ? AppColors.primary : Colors.grey.shade300,
|
||||
width: 1.5,
|
||||
),
|
||||
),
|
||||
child: Checkbox(
|
||||
value: isSelected,
|
||||
activeColor: AppColors.primary,
|
||||
checkColor: AppColors.white,
|
||||
onChanged: (_) {
|
||||
context
|
||||
.read<OrderFormBloc>()
|
||||
.add(OrderFormEvent.toggleItem(product));
|
||||
},
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
|
||||
@@ -587,114 +587,112 @@ class _SplitBillPageState extends State<SplitBillPage> {
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColorSplitBill.cardBackground,
|
||||
border: Border.all(color: AppColorSplitBill.border),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Split Bill',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColorSplitBill.primary,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColorSplitBill.cardBackground,
|
||||
border: Border.all(color: AppColorSplitBill.border),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'Split Bill',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColorSplitBill.primary,
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'Jumlah yang akan dibayar:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Text(
|
||||
'Jumlah yang akan dibayar:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColorSplitBill.border),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Container(
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(color: AppColorSplitBill.border),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: TextField(
|
||||
controller: amountController,
|
||||
keyboardType: TextInputType.number,
|
||||
style: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.textPrimary,
|
||||
),
|
||||
child: TextField(
|
||||
controller: amountController,
|
||||
keyboardType: TextInputType.number,
|
||||
style: TextStyle(
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
splitAmount = int.tryParse(value) ?? 0;
|
||||
});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
hintText: '0',
|
||||
prefixText: 'Rp ',
|
||||
prefixStyle: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.textPrimary,
|
||||
),
|
||||
onChanged: (value) {
|
||||
setState(() {
|
||||
splitAmount = int.tryParse(value) ?? 0;
|
||||
});
|
||||
},
|
||||
decoration: InputDecoration(
|
||||
hintText: '0',
|
||||
prefixText: 'Rp ',
|
||||
prefixStyle: TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.textPrimary,
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
),
|
||||
border: InputBorder.none,
|
||||
contentPadding: EdgeInsets.all(16),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total yang dibayar:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.textPrimary,
|
||||
),
|
||||
),
|
||||
SizedBox(height: 16),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Total yang dibayar:',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.textPrimary,
|
||||
),
|
||||
Text(
|
||||
'Rp ${_formatCurrency(splitAmount)}',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.primary,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Rp ${_formatCurrency(splitAmount)}',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
color: AppColorSplitBill.primary,
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Sisa bill:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 8),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'Sisa bill:',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
Text(
|
||||
'Rp ${_formatCurrency((widget.order.totalAmount ?? 0) - splitAmount)}',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'Rp ${_formatCurrency((widget.order.totalAmount ?? 0) - splitAmount)}',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColorSplitBill.textSecondary,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user