const constructure
This commit is contained in:
@@ -36,8 +36,8 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(width: 1, color: AppColor.border),
|
||||
),
|
||||
@@ -48,8 +48,12 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Icon(Icons.receipt_long, color: AppColor.primary, size: 24),
|
||||
SpaceWidth(12),
|
||||
const Icon(
|
||||
Icons.receipt_long,
|
||||
color: AppColor.primary,
|
||||
size: 24,
|
||||
),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
@@ -71,7 +75,10 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12, vertical: 6),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: _getStatusColor(
|
||||
widget.state.order.status,
|
||||
@@ -95,18 +102,18 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(
|
||||
controller: _scrollController,
|
||||
padding: EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
const Icon(
|
||||
Icons.shopping_cart,
|
||||
color: AppColor.primary,
|
||||
size: 20,
|
||||
),
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
Text(
|
||||
'Produk Pesanan (${widget.state.pendingItems.length})',
|
||||
style: AppStyle.lg.copyWith(
|
||||
@@ -116,7 +123,7 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
),
|
||||
],
|
||||
),
|
||||
SpaceHeight(16),
|
||||
const SpaceHeight(16),
|
||||
|
||||
...List.generate(widget.state.pendingItems.length, (index) {
|
||||
final item = widget.state.pendingItems[index];
|
||||
@@ -158,7 +165,7 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
_buildSummaryRow(
|
||||
@@ -173,7 +180,7 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
// 'Diskon:',
|
||||
// '- ${(widget.state.order.discountAmount).currencyFormatRpV2}',
|
||||
// ),
|
||||
Divider(thickness: 1),
|
||||
const Divider(thickness: 1),
|
||||
_buildSummaryRow(
|
||||
'Total:',
|
||||
(widget.state.order.totalAmount).currencyFormatRpV2,
|
||||
@@ -203,7 +210,7 @@ class _VoidLeftPanelState extends State<VoidLeftPanel> {
|
||||
bool isVoid = false,
|
||||
}) {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: 4),
|
||||
padding: const EdgeInsets.symmetric(vertical: 4),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
|
||||
@@ -25,7 +25,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(bottom: 12),
|
||||
margin: const EdgeInsets.only(bottom: 12),
|
||||
decoration: BoxDecoration(
|
||||
color: isSelected ? AppColor.primary.withOpacity(0.1) : Colors.white,
|
||||
border: Border.all(
|
||||
@@ -35,7 +35,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
child: Column(
|
||||
children: [
|
||||
Row(
|
||||
@@ -58,11 +58,11 @@ class VoidProductCard extends StatelessWidget {
|
||||
color: AppColor.textSecondary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(4),
|
||||
const SpaceHeight(4),
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 2,
|
||||
),
|
||||
@@ -78,7 +78,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
Text(
|
||||
(item.unitPrice).currencyFormatRpV2,
|
||||
style: AppStyle.sm.copyWith(
|
||||
@@ -89,9 +89,9 @@ class VoidProductCard extends StatelessWidget {
|
||||
),
|
||||
if (item.notes.isNotEmpty)
|
||||
Padding(
|
||||
padding: EdgeInsets.only(top: 4),
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 2,
|
||||
),
|
||||
@@ -124,7 +124,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
InkWell(
|
||||
onTap: onTapDecrease,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Icon(
|
||||
Icons.remove,
|
||||
size: 16,
|
||||
@@ -137,11 +137,11 @@ class VoidProductCard extends StatelessWidget {
|
||||
|
||||
// Quantity Display
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 8,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
decoration: const BoxDecoration(
|
||||
border: Border.symmetric(
|
||||
vertical: BorderSide(color: AppColor.border),
|
||||
),
|
||||
@@ -158,7 +158,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
InkWell(
|
||||
onTap: onTapIncrease,
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
child: Icon(
|
||||
Icons.add,
|
||||
size: 16,
|
||||
@@ -171,7 +171,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
],
|
||||
),
|
||||
),
|
||||
SpaceWidth(20),
|
||||
const SpaceWidth(20),
|
||||
],
|
||||
// Price
|
||||
Column(
|
||||
@@ -186,7 +186,7 @@ class VoidProductCard extends StatelessWidget {
|
||||
),
|
||||
if (isSelected)
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 6,
|
||||
vertical: 2,
|
||||
),
|
||||
|
||||
@@ -40,8 +40,8 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: const BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(width: 1, color: AppColor.border),
|
||||
),
|
||||
@@ -68,7 +68,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
thumbVisibility: true,
|
||||
child: SingleChildScrollView(
|
||||
controller: _scrollController,
|
||||
padding: EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
@@ -79,7 +79,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
VoidRadio(
|
||||
voidType: widget.state.voidType,
|
||||
value: VoidType.all,
|
||||
@@ -87,14 +87,14 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
subtitle: "Batalkan pesanan lengkap dan semua item",
|
||||
onChanged: (VoidType? value) {
|
||||
context.read<VoidFormBloc>().add(
|
||||
VoidFormEvent.clearSelectedItem(),
|
||||
const VoidFormEvent.clearSelectedItem(),
|
||||
);
|
||||
context.read<VoidFormBloc>().add(
|
||||
VoidFormEvent.voidTypeChanged(value!),
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
VoidRadio(
|
||||
voidType: widget.state.voidType,
|
||||
value: VoidType.item,
|
||||
@@ -107,12 +107,12 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
|
||||
// Selected Items Summary (only show for item void)
|
||||
if (widget.state.voidType.isItem) ...[
|
||||
Container(
|
||||
padding: EdgeInsets.all(16),
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
color: widget.state.selectedItemQuantities.isEmpty
|
||||
? AppColor.warning.withOpacity(0.1)
|
||||
@@ -142,7 +142,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
: AppColor.success,
|
||||
size: 20,
|
||||
),
|
||||
SpaceWidth(8),
|
||||
const SpaceWidth(8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
widget.state.selectedItemQuantities.isEmpty
|
||||
@@ -166,9 +166,11 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
.state
|
||||
.selectedItemQuantities
|
||||
.isNotEmpty) ...[
|
||||
SpaceHeight(12),
|
||||
const SpaceHeight(12),
|
||||
Container(
|
||||
constraints: BoxConstraints(maxHeight: 150),
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: 150,
|
||||
),
|
||||
child: Scrollbar(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
@@ -188,10 +190,10 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
item.id == entry.key,
|
||||
);
|
||||
return Container(
|
||||
margin: EdgeInsets.only(
|
||||
margin: const EdgeInsets.only(
|
||||
bottom: 8,
|
||||
),
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius:
|
||||
@@ -247,9 +249,9 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(height: 16, thickness: 1),
|
||||
const Divider(height: 16, thickness: 1),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.error,
|
||||
borderRadius: BorderRadius.circular(6),
|
||||
@@ -282,7 +284,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
],
|
||||
),
|
||||
),
|
||||
SpaceHeight(24),
|
||||
const SpaceHeight(24),
|
||||
],
|
||||
|
||||
Text(
|
||||
@@ -292,7 +294,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
color: AppColor.primary,
|
||||
),
|
||||
),
|
||||
SpaceHeight(8),
|
||||
const SpaceHeight(8),
|
||||
AppTextFormField(
|
||||
label: 'Harap berikan alasan untuk membatalkan...',
|
||||
showLabel: false,
|
||||
@@ -303,7 +305,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
);
|
||||
},
|
||||
),
|
||||
SpaceHeight(32),
|
||||
const SpaceHeight(32),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -312,7 +314,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
|
||||
// Action Buttons
|
||||
Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
padding: const EdgeInsets.all(20),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -321,7 +323,7 @@ class _VoidRightPanelState extends State<VoidRightPanel> {
|
||||
label: 'Batal',
|
||||
),
|
||||
),
|
||||
SpaceWidth(12),
|
||||
const SpaceWidth(12),
|
||||
Expanded(
|
||||
child: AppElevatedButton.filled(
|
||||
onPressed: _canProcessVoid() ? _processVoid : null,
|
||||
|
||||
Reference in New Issue
Block a user