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'; import 'package:enaklo_pos/data/models/response/order_response_model.dart'; import 'package:flutter/material.dart'; class SalesPayment extends StatelessWidget { final Order? order; 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( 'Subtotal ${order?.orderItems?.length} Produk', style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w600, ), ), Text( (order?.subtotal)?.currencyFormatRp ?? "0", style: const TextStyle( fontSize: 16, fontWeight: FontWeight.w600, ), ), ], ), SpaceHeight(12), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( 'Pajak', style: const TextStyle( fontSize: 16, ), ), Text( (order?.taxAmount)?.currencyFormatRp ?? "0", 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( (order?.totalAmount)?.currencyFormatRp ?? "0", style: const TextStyle( color: AppColors.primary, fontSize: 18, fontWeight: FontWeight.w700, ), ), ], ), ], ), ); } }