feat: sales list order
This commit is contained in:
parent
051b64e3a6
commit
7a195705af
@ -167,6 +167,20 @@ class _SalesPageState extends State<SalesPage> {
|
|||||||
SalesRightTitle(
|
SalesRightTitle(
|
||||||
order: orderDetail,
|
order: orderDetail,
|
||||||
actionWidget: [
|
actionWidget: [
|
||||||
|
if (widget.status == 'pending') ...[
|
||||||
|
Button.outlined(
|
||||||
|
onPressed: () {},
|
||||||
|
label: 'Void',
|
||||||
|
icon: Icon(Icons.undo),
|
||||||
|
),
|
||||||
|
SpaceWidth(8),
|
||||||
|
Button.outlined(
|
||||||
|
onPressed: () {},
|
||||||
|
label: 'Bayar',
|
||||||
|
icon: Icon(Icons.payment),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
if (widget.status == 'completed')
|
||||||
Button.outlined(
|
Button.outlined(
|
||||||
onPressed: () {},
|
onPressed: () {},
|
||||||
label: 'Refund',
|
label: 'Refund',
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
|
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||||
|
import 'package:enaklo_pos/core/extensions/string_ext.dart';
|
||||||
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
@ -34,6 +36,7 @@ class SalesListOrder extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
SpaceHeight(12),
|
||||||
Column(
|
Column(
|
||||||
children: List.generate(
|
children: List.generate(
|
||||||
order?.orderItems?.length ?? 0,
|
order?.orderItems?.length ?? 0,
|
||||||
@ -48,20 +51,22 @@ class SalesListOrder extends StatelessWidget {
|
|||||||
Padding _item(OrderItem product) {
|
Padding _item(OrderItem product) {
|
||||||
return Padding(
|
return Padding(
|
||||||
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16)
|
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 16)
|
||||||
.copyWith(bottom: 0),
|
.copyWith(top: 0),
|
||||||
child: Row(
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Column(
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
product.productName ?? '',
|
product.productName ?? '',
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
(product.unitPrice ?? 0).toString(),
|
(product.unitPrice ?? 0).toString().currencyFormatRpV2,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
@ -75,7 +80,7 @@ class SalesListOrder extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Text(
|
Text(
|
||||||
(product.totalPrice ?? 0).toString(),
|
(product.totalPrice ?? 0).toString().currencyFormatRpV2,
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user