feat: update
This commit is contained in:
@@ -285,8 +285,8 @@ class SalesListOrder extends StatelessWidget {
|
||||
|
||||
switch (status) {
|
||||
case "pending":
|
||||
backgroundColor = Colors.orange.withOpacity(0.1);
|
||||
textColor = Colors.orange.shade700;
|
||||
backgroundColor = Colors.white;
|
||||
textColor = Colors.white;
|
||||
displayText = "Pending";
|
||||
icon = Icons.access_time;
|
||||
break;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:enaklo_pos/core/components/spaces.dart';
|
||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||
import 'package:enaklo_pos/core/extensions/int_ext.dart';
|
||||
import 'package:enaklo_pos/core/extensions/string_ext.dart';
|
||||
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@@ -31,29 +32,18 @@ class SalesPayment extends StatelessWidget {
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.amber.shade100,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
order?.paymentStatus ?? "",
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.amber.shade800,
|
||||
),
|
||||
),
|
||||
),
|
||||
_buildPaymentStatus(),
|
||||
],
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
...List.generate(
|
||||
order?.payments?.length ?? 0,
|
||||
(index) => _buildPaymentItem(order?.payments?[index] ?? Payment()),
|
||||
(index) => Padding(
|
||||
padding: const EdgeInsets.only(bottom: 8.0),
|
||||
child: _buildPaymentItem(order?.payments?[index] ?? Payment()),
|
||||
),
|
||||
),
|
||||
const SpaceHeight(12),
|
||||
const SpaceHeight(4),
|
||||
const Divider(),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
@@ -96,6 +86,43 @@ class SalesPayment extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
Container _buildPaymentStatus() {
|
||||
switch (order?.paymentStatus) {
|
||||
case 'completed':
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.green.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
(order?.paymentStatus ?? "").toTitleCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.green,
|
||||
),
|
||||
),
|
||||
);
|
||||
default:
|
||||
return Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.amber.shade100,
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
child: Text(
|
||||
(order?.paymentStatus ?? "").toTitleCase(),
|
||||
style: TextStyle(
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.amber.shade800,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Row _buildPaymentItem(Payment payment) {
|
||||
return Row(
|
||||
children: [
|
||||
|
||||
Reference in New Issue
Block a user