2025-08-02 10:50:48 +07:00
|
|
|
import 'package:enaklo_pos/core/components/dashed_divider.dart';
|
|
|
|
|
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';
|
2025-08-03 14:39:15 +07:00
|
|
|
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
2025-08-02 10:50:48 +07:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
|
|
class SalesPayment extends StatelessWidget {
|
2025-08-03 14:39:15 +07:00
|
|
|
final Order? order;
|
2025-08-02 10:50:48 +07:00
|
|
|
const SalesPayment({super.key, this.order});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
return Container(
|
|
|
|
|
padding: const EdgeInsets.all(16),
|
|
|
|
|
margin: const EdgeInsets.only(top: 16),
|
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
|
color: AppColors.white,
|
|
|
|
|
borderRadius: BorderRadius.circular(8),
|
|
|
|
|
),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'Informasi Pesanan',
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
color: AppColors.black,
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
SpaceHeight(12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2025-08-03 14:39:15 +07:00
|
|
|
'Subtotal ${order?.orderItems?.length} Produk',
|
2025-08-02 10:50:48 +07:00
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
2025-08-03 14:39:15 +07:00
|
|
|
(order?.subtotal)?.currencyFormatRp ?? "0",
|
2025-08-02 10:50:48 +07:00
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SpaceHeight(12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
2025-08-03 14:39:15 +07:00
|
|
|
'Pajak',
|
2025-08-02 10:50:48 +07:00
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
2025-08-03 14:39:15 +07:00
|
|
|
(order?.taxAmount)?.currencyFormatRp ?? "0",
|
2025-08-02 10:50:48 +07:00
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 16,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
SpaceHeight(12),
|
|
|
|
|
DashedDivider(
|
|
|
|
|
color: AppColors.stroke,
|
|
|
|
|
),
|
|
|
|
|
SpaceHeight(12),
|
|
|
|
|
Row(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: [
|
|
|
|
|
Text(
|
|
|
|
|
'Total',
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
Text(
|
2025-08-03 14:39:15 +07:00
|
|
|
(order?.totalAmount)?.currencyFormatRp ?? "0",
|
2025-08-02 10:50:48 +07:00
|
|
|
style: const TextStyle(
|
|
|
|
|
color: AppColors.primary,
|
|
|
|
|
fontSize: 18,
|
|
|
|
|
fontWeight: FontWeight.w700,
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|