fix split bill
This commit is contained in:
@@ -481,6 +481,56 @@ Future<void> onPrinVoidRecipt(
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> onPrintSplit(
|
||||
context, {
|
||||
required Order order,
|
||||
}) async {
|
||||
final receiptPrinter =
|
||||
await PrinterLocalDatasource.instance.getPrinterByCode('receipt');
|
||||
final authData = await AuthLocalDataSource().getAuthData();
|
||||
final settings = await SettingsLocalDatasource().getTax();
|
||||
final outlet = await OutletLocalDatasource().get();
|
||||
|
||||
if (receiptPrinter != null) {
|
||||
try {
|
||||
final printValue = await PrintDataoutputs.instance.printSplitBill(
|
||||
order,
|
||||
authData.user?.name ?? "",
|
||||
receiptPrinter.paper.toIntegerFromText,
|
||||
outlet,
|
||||
);
|
||||
await PrinterService()
|
||||
.printWithPrinter(receiptPrinter, printValue, context);
|
||||
} catch (e, stackTrace) {
|
||||
FirebaseCrashlytics.instance.recordError(
|
||||
e,
|
||||
stackTrace,
|
||||
reason: 'Print receipt failed',
|
||||
information: [
|
||||
'Order ID: ${order.id}',
|
||||
'Printer: ${receiptPrinter.name}',
|
||||
],
|
||||
);
|
||||
log("Error printing receipt order: $e");
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Error printing receipt order: $e')),
|
||||
);
|
||||
}
|
||||
} else {
|
||||
FirebaseCrashlytics.instance.recordError(
|
||||
'Kitchen printer not found',
|
||||
null,
|
||||
reason: 'Kitchen printer not found / Printer not setting in printer page',
|
||||
information: [
|
||||
'Order ID: ${order.id}',
|
||||
],
|
||||
);
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Anda belum menghubungkan printer kitchen')),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<Uint8List> generateBarcodeAsUint8List(String data) async {
|
||||
// 1. Buat barcode instance (code128, qrCode, dll)
|
||||
final barcode = Barcode.code128();
|
||||
|
||||
@@ -1843,4 +1843,267 @@ class PrintDataoutputs {
|
||||
|
||||
return allBytes;
|
||||
}
|
||||
|
||||
Future<List<int>> printSplitBill(
|
||||
Order order,
|
||||
String chashierName,
|
||||
int paper,
|
||||
Outlet outlet,
|
||||
) async {
|
||||
List<int> bytes = [];
|
||||
|
||||
final profile = await CapabilityProfile.load();
|
||||
final generator =
|
||||
Generator(paper == 58 ? PaperSize.mm58 : PaperSize.mm80, profile);
|
||||
|
||||
bytes += generator.reset();
|
||||
|
||||
bytes += generator.text(outlet.name ?? "",
|
||||
styles: const PosStyles(
|
||||
bold: true,
|
||||
align: PosAlign.center,
|
||||
height: PosTextSize.size1,
|
||||
width: PosTextSize.size1,
|
||||
));
|
||||
|
||||
bytes += generator.text(outlet.address ?? "",
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.text(outlet.phoneNumber ?? "",
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: DateFormat('dd MMM yyyy').format(DateTime.now()),
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: DateFormat('HH:mm').format(DateTime.now()),
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Receipt Number',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: DateFormat('yyyyMMddhhmm').format(DateTime.now()),
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Order ID',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: Random().nextInt(100000).toString(),
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Bill Name',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: order.metadata?['customer_name'] ?? '',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Collected By',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: chashierName,
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
if (order.payments != null) {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Payment',
|
||||
width: 8,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: order.payments?.last.paymentMethodName ?? '-',
|
||||
width: 4,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.text(order.orderType ?? '-',
|
||||
styles: const PosStyles(bold: true, align: PosAlign.center));
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.text("SPLIT",
|
||||
styles: const PosStyles(bold: true, align: PosAlign.center));
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
|
||||
for (final item in (order.orderItems ?? <OrderItem>[])) {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: '${item.quantity} x ${item.productName}',
|
||||
width: 8,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (((item.unitPrice ?? 0) * (item.quantity ?? 0)))
|
||||
.currencyFormatRpV2,
|
||||
width: 4,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
if (item.notes != '') {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Note',
|
||||
width: 4,
|
||||
styles: const PosStyles(bold: false, align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: item.notes ?? "-",
|
||||
width: 8,
|
||||
styles: const PosStyles(bold: false, align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
if (order.orderItems?.isNotEmpty ?? false) {
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
}
|
||||
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Subtotal',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: order.payments?.last.amount?.currencyFormatRpV2 ?? '-',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Discount',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (order.discountAmount ?? 0).currencyFormatRpV2,
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
|
||||
// Only show tax if it's greater than 0
|
||||
if ((order.taxAmount ?? 0) > 0) {
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Tax PB1 (${order.taxAmount}%)',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: (order.taxAmount ?? 0).currencyFormatRpV2,
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
}
|
||||
|
||||
// Only show service charge if it's greater than 0
|
||||
// if (serviceCharge > 0) {
|
||||
// bytes += generator.row([
|
||||
// PosColumn(
|
||||
// text: 'Service Charge($serviceChargePercentage%)',
|
||||
// width: 6,
|
||||
// styles: const PosStyles(align: PosAlign.left),
|
||||
// ),
|
||||
// PosColumn(
|
||||
// text: serviceCharge.currencyFormatRpV2,
|
||||
// width: 6,
|
||||
// styles: const PosStyles(align: PosAlign.right),
|
||||
// ),
|
||||
// ]);
|
||||
// }
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Total',
|
||||
width: 6,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: order.payments?.last.amount?.currencyFormatRpV2 ?? '-',
|
||||
width: 6,
|
||||
styles: const PosStyles(bold: true, align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
bytes += generator.row([
|
||||
PosColumn(
|
||||
text: 'Dibayar',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.left),
|
||||
),
|
||||
PosColumn(
|
||||
text: order.payments?.last.amount?.currencyFormatRpV2 ?? '-',
|
||||
width: 6,
|
||||
styles: const PosStyles(align: PosAlign.right),
|
||||
),
|
||||
]);
|
||||
bytes += generator.text(
|
||||
paper == 80
|
||||
? '------------------------------------------------'
|
||||
: '--------------------------------',
|
||||
styles: const PosStyles(bold: false, align: PosAlign.center));
|
||||
paper == 80 ? bytes += generator.feed(3) : bytes += generator.feed(1);
|
||||
bytes += generator.cut();
|
||||
return bytes;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,3 +401,103 @@ extension OrderItemListExtension on List<OrderItem> {
|
||||
quantity: e.quantity ?? 0,
|
||||
)).toList();
|
||||
}
|
||||
|
||||
extension OrderCopyWith on Order {
|
||||
Order copyWith({
|
||||
String? id,
|
||||
String? orderNumber,
|
||||
String? outletId,
|
||||
String? userId,
|
||||
String? tableNumber,
|
||||
String? orderType,
|
||||
String? status,
|
||||
int? subtotal,
|
||||
int? taxAmount,
|
||||
int? discountAmount,
|
||||
int? totalAmount,
|
||||
num? totalCost,
|
||||
int? remainingAmount,
|
||||
String? paymentStatus,
|
||||
int? refundAmount,
|
||||
bool? isVoid,
|
||||
bool? isRefund,
|
||||
String? notes,
|
||||
Map<String, dynamic>? metadata,
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt,
|
||||
List<OrderItem>? orderItems,
|
||||
List<Payment>? payments,
|
||||
int? totalPaid,
|
||||
int? paymentCount,
|
||||
String? splitType,
|
||||
}) {
|
||||
return Order(
|
||||
id: id ?? this.id,
|
||||
orderNumber: orderNumber ?? this.orderNumber,
|
||||
outletId: outletId ?? this.outletId,
|
||||
userId: userId ?? this.userId,
|
||||
tableNumber: tableNumber ?? this.tableNumber,
|
||||
orderType: orderType ?? this.orderType,
|
||||
status: status ?? this.status,
|
||||
subtotal: subtotal ?? this.subtotal,
|
||||
taxAmount: taxAmount ?? this.taxAmount,
|
||||
discountAmount: discountAmount ?? this.discountAmount,
|
||||
totalAmount: totalAmount ?? this.totalAmount,
|
||||
totalCost: totalCost ?? this.totalCost,
|
||||
remainingAmount: remainingAmount ?? this.remainingAmount,
|
||||
paymentStatus: paymentStatus ?? this.paymentStatus,
|
||||
refundAmount: refundAmount ?? this.refundAmount,
|
||||
isVoid: isVoid ?? this.isVoid,
|
||||
isRefund: isRefund ?? this.isRefund,
|
||||
notes: notes ?? this.notes,
|
||||
metadata: metadata ?? this.metadata,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
updatedAt: updatedAt ?? this.updatedAt,
|
||||
orderItems: orderItems ?? this.orderItems,
|
||||
payments: payments ?? this.payments,
|
||||
totalPaid: totalPaid ?? this.totalPaid,
|
||||
paymentCount: paymentCount ?? this.paymentCount,
|
||||
splitType: splitType ?? this.splitType,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension OrderItemCopyWith on OrderItem {
|
||||
OrderItem copyWith({
|
||||
String? id,
|
||||
String? orderId,
|
||||
String? productId,
|
||||
String? productName,
|
||||
String? productVariantId,
|
||||
String? productVariantName,
|
||||
int? quantity,
|
||||
int? unitPrice,
|
||||
int? totalPrice,
|
||||
List<dynamic>? modifiers,
|
||||
String? notes,
|
||||
String? status,
|
||||
DateTime? createdAt,
|
||||
DateTime? updatedAt,
|
||||
String? printerType,
|
||||
int? paidQuantity,
|
||||
}) {
|
||||
return OrderItem(
|
||||
id: id ?? this.id,
|
||||
orderId: orderId ?? this.orderId,
|
||||
productId: productId ?? this.productId,
|
||||
productName: productName ?? this.productName,
|
||||
productVariantId: productVariantId ?? this.productVariantId,
|
||||
productVariantName: productVariantName ?? this.productVariantName,
|
||||
quantity: quantity ?? this.quantity,
|
||||
unitPrice: unitPrice ?? this.unitPrice,
|
||||
totalPrice: totalPrice ?? this.totalPrice,
|
||||
modifiers: modifiers ?? this.modifiers,
|
||||
notes: notes ?? this.notes,
|
||||
status: status ?? this.status,
|
||||
createdAt: createdAt ?? this.createdAt,
|
||||
updatedAt: updatedAt ?? this.updatedAt,
|
||||
printerType: printerType ?? this.printerType,
|
||||
paidQuantity: paidQuantity ?? this.paidQuantity,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import 'package:enaklo_pos/presentation/home/bloc/payment_methods/payment_method
|
||||
import 'package:enaklo_pos/presentation/home/models/product_quantity.dart';
|
||||
import 'package:enaklo_pos/presentation/sales/blocs/payment_form/payment_form_bloc.dart';
|
||||
import 'package:enaklo_pos/presentation/success/pages/success_payment_page.dart';
|
||||
import 'package:enaklo_pos/presentation/success/pages/success_split_bill_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
@@ -370,23 +371,43 @@ class _PaymentPageState extends State<PaymentPage> {
|
||||
state.maybeWhen(
|
||||
orElse: () {},
|
||||
success: (data) {
|
||||
context.pushReplacement(SuccessPaymentPage(
|
||||
productQuantity: getOrderItemPending()
|
||||
.map(
|
||||
(item) => ProductQuantity(
|
||||
product: Product(
|
||||
name: item.productName,
|
||||
price: item.unitPrice,
|
||||
),
|
||||
quantity: item.quantity ?? 0,
|
||||
if (widget.isSplit) {
|
||||
context.pushReplacement(SuccessSplitBillPage(
|
||||
productQuantity: getOrderItemPending()
|
||||
.map(
|
||||
(item) => ProductQuantity(
|
||||
product: Product(
|
||||
name: item.productName,
|
||||
price: item.unitPrice,
|
||||
),
|
||||
)
|
||||
.toList() ??
|
||||
[],
|
||||
payment: data,
|
||||
paymentMethod: selectedPaymentMethod?.name ?? '',
|
||||
nominalBayar: totalPriceController.text.toIntegerFromText,
|
||||
));
|
||||
quantity: item.quantity ?? 0,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
payment: data,
|
||||
paymentMethod: selectedPaymentMethod?.name ?? '',
|
||||
nominalBayar:
|
||||
totalPriceController.text.toIntegerFromText,
|
||||
));
|
||||
} else {
|
||||
context.pushReplacement(SuccessPaymentPage(
|
||||
productQuantity: getOrderItemPending()
|
||||
.map(
|
||||
(item) => ProductQuantity(
|
||||
product: Product(
|
||||
name: item.productName,
|
||||
price: item.unitPrice,
|
||||
),
|
||||
quantity: item.quantity ?? 0,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
payment: data,
|
||||
paymentMethod: selectedPaymentMethod?.name ?? '',
|
||||
nominalBayar:
|
||||
totalPriceController.text.toIntegerFromText,
|
||||
));
|
||||
}
|
||||
},
|
||||
error: (message) {
|
||||
AppFlushbar.showError(context, message);
|
||||
|
||||
@@ -0,0 +1,993 @@
|
||||
import 'package:enaklo_pos/core/constants/colors.dart';
|
||||
import 'package:enaklo_pos/core/extensions/build_context_ext.dart';
|
||||
import 'package:enaklo_pos/core/extensions/date_time_ext.dart';
|
||||
import 'package:enaklo_pos/core/extensions/int_ext.dart';
|
||||
import 'package:enaklo_pos/core/extensions/string_ext.dart';
|
||||
import 'package:enaklo_pos/core/function/app_function.dart';
|
||||
import 'package:enaklo_pos/data/models/response/order_response_model.dart';
|
||||
import 'package:enaklo_pos/data/models/response/payment_response_model.dart';
|
||||
import 'package:enaklo_pos/presentation/home/models/product_quantity.dart';
|
||||
import 'package:enaklo_pos/presentation/home/pages/dashboard_page.dart';
|
||||
import 'package:enaklo_pos/presentation/sales/blocs/order_loader/order_loader_bloc.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
|
||||
class SuccessSplitBillPage extends StatefulWidget {
|
||||
final List<ProductQuantity> productQuantity;
|
||||
final PaymentData payment;
|
||||
final String paymentMethod;
|
||||
final int nominalBayar;
|
||||
const SuccessSplitBillPage({
|
||||
super.key,
|
||||
required this.payment,
|
||||
required this.productQuantity,
|
||||
required this.paymentMethod,
|
||||
required this.nominalBayar,
|
||||
});
|
||||
|
||||
@override
|
||||
State<SuccessSplitBillPage> createState() => _SuccessSplitBillPageState();
|
||||
}
|
||||
|
||||
class _SuccessSplitBillPageState extends State<SuccessSplitBillPage> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
context
|
||||
.read<OrderLoaderBloc>()
|
||||
.add(OrderLoaderEvent.getById(widget.payment.orderId ?? ""));
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
backgroundColor: AppColors.background,
|
||||
body: SafeArea(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.05),
|
||||
AppColors.background,
|
||||
AppColors.background,
|
||||
],
|
||||
),
|
||||
),
|
||||
child: BlocBuilder<OrderLoaderBloc, OrderLoaderState>(
|
||||
builder: (context, state) {
|
||||
return state.maybeWhen(
|
||||
orElse: () => SizedBox.shrink(),
|
||||
loading: () => Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
loadedDetail: (order) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Row(
|
||||
children: [
|
||||
// Left Panel - Success Message & Order Info
|
||||
Expanded(
|
||||
flex: 35,
|
||||
child: _buildLeftPanel(order),
|
||||
),
|
||||
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// Right Panel - Order Details
|
||||
Expanded(
|
||||
flex: 65,
|
||||
child: _buildRightPanel(order),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildLeftPanel(Order order) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.1),
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Success Header
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(32.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
AppColors.primary.withOpacity(0.05),
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(24),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Success Icon
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
AppColors.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
shape: BoxShape.circle,
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
blurRadius: 20,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: const Icon(
|
||||
Icons.check_rounded,
|
||||
size: 48,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Success Title
|
||||
const Text(
|
||||
'Split Bill Berhasil!',
|
||||
style: TextStyle(
|
||||
fontSize: 26,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 16,
|
||||
vertical: 8,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
),
|
||||
child: const Text(
|
||||
'Pesanan telah diterima dan sedang diproses',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: AppColors.primary,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
// Order Information Section
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_buildSectionTitle('Informasi Pesanan'),
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Customer Card
|
||||
_buildInfoCard(
|
||||
icon: Icons.person_outline_rounded,
|
||||
title: 'Nama Pelanggan',
|
||||
value: order.metadata?['customer_name'] ?? "-",
|
||||
gradient: [
|
||||
Colors.blue.withOpacity(0.1),
|
||||
Colors.purple.withOpacity(0.1),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Order Details
|
||||
Column(
|
||||
children: [
|
||||
_buildInfoRow(
|
||||
icon: Icons.receipt_long_outlined,
|
||||
label: 'No. Pesanan',
|
||||
value: order.orderNumber ?? "-",
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.receipt_long_outlined,
|
||||
label: 'Metode Pembayaran',
|
||||
value: widget.paymentMethod,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.access_time_rounded,
|
||||
label: 'Waktu',
|
||||
value: (order.createdAt ?? DateTime.now())
|
||||
.toFormattedDate3(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
_buildInfoRow(
|
||||
icon: Icons.check_circle_outline,
|
||||
label: 'Status Pembayaran',
|
||||
value: 'Lunas',
|
||||
valueColor: Colors.green,
|
||||
showBadge: true,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Total and Action Buttons
|
||||
_buildBottomSection(order),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildRightPanel(Order order) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.08),
|
||||
blurRadius: 30,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Header
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.background,
|
||||
Colors.grey.shade50,
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
top: Radius.circular(24),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.2),
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.receipt_long_rounded,
|
||||
color: AppColors.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Text(
|
||||
'Detail Pesanan',
|
||||
style: TextStyle(
|
||||
fontSize: 20,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 4),
|
||||
Text(
|
||||
'Ringkasan item yang dipesan',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 16, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
AppColors.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(20),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
'${widget.productQuantity.length} Items',
|
||||
style: const TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
// Product List
|
||||
Expanded(
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
itemCount: widget.productQuantity.length,
|
||||
separatorBuilder: (context, index) => const SizedBox(height: 12),
|
||||
itemBuilder: (context, index) {
|
||||
return _buildProductCard(index);
|
||||
},
|
||||
),
|
||||
),
|
||||
|
||||
// Summary Footer
|
||||
_buildSummaryFooter(order),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildProductCard(int index) {
|
||||
final item = widget.productQuantity[index];
|
||||
final totalPrice = (item.product.price ?? 0) * item.quantity;
|
||||
|
||||
return Container(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
Colors.grey.shade50,
|
||||
Colors.white,
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
border: Border.all(
|
||||
color: Colors.grey.withOpacity(0.1),
|
||||
width: 1,
|
||||
),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.04),
|
||||
blurRadius: 10,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
// Product Image
|
||||
Container(
|
||||
width: 70,
|
||||
height: 70,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.2),
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.2),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Icon(
|
||||
Icons.restaurant_rounded,
|
||||
color: AppColors.primary,
|
||||
size: 28,
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// Product Details
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.product.name ?? "-",
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
maxLines: 2,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
),
|
||||
const SizedBox(height: 6),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.grey.shade100,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Text(
|
||||
(item.product.price ?? 0).toString().currencyFormatRpV2,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade700,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 16),
|
||||
|
||||
// Quantity and Total
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
padding:
|
||||
const EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
AppColors.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
blurRadius: 6,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
'${item.quantity}x',
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
totalPrice.toString().currencyFormatRpV2,
|
||||
style: const TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSectionTitle(String title) {
|
||||
return Text(
|
||||
title,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoCard({
|
||||
required IconData icon,
|
||||
required String title,
|
||||
required String value,
|
||||
required List<Color> gradient,
|
||||
}) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(20.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: gradient,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16.0),
|
||||
border: Border.all(
|
||||
color: Colors.white.withOpacity(0.3),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 20,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
title,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
color: Colors.grey.shade600,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
Text(
|
||||
value,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildInfoRow({
|
||||
required IconData icon,
|
||||
required String label,
|
||||
required String value,
|
||||
Color? valueColor,
|
||||
bool showBadge = false,
|
||||
}) {
|
||||
return Row(
|
||||
children: [
|
||||
Icon(
|
||||
icon,
|
||||
size: 18,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
Expanded(
|
||||
child: Text(
|
||||
label,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
),
|
||||
),
|
||||
if (showBadge && valueColor != null)
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: 4,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: valueColor.withOpacity(0.1),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.check_circle,
|
||||
size: 14,
|
||||
color: valueColor,
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: valueColor,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
Text(
|
||||
value,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: valueColor ?? Colors.black87,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottomSection(Order order) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.grey.shade50,
|
||||
Colors.white,
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(24),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Total Amount
|
||||
Container(
|
||||
padding: const EdgeInsets.all(20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
AppColors.primary.withOpacity(0.05),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: AppColors.primary.withOpacity(0.2),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
const Text(
|
||||
'Total Pembayaran',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
widget.nominalBayar.currencyFormatRpV2,
|
||||
style: const TextStyle(
|
||||
fontSize: 24,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(height: 24),
|
||||
|
||||
// Action Buttons
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
border: Border.all(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
width: 2,
|
||||
),
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(14),
|
||||
onTap: () {
|
||||
context.push(DashboardPage());
|
||||
},
|
||||
child: const Center(
|
||||
child: Text(
|
||||
'Kembali ke Beranda',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 16),
|
||||
Expanded(
|
||||
child: Container(
|
||||
height: 50,
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.centerLeft,
|
||||
end: Alignment.centerRight,
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
AppColors.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0, 4),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
child: InkWell(
|
||||
borderRadius: BorderRadius.circular(16),
|
||||
onTap: () async {
|
||||
final updatedOrderItems =
|
||||
widget.productQuantity.map((pq) {
|
||||
return OrderItem(
|
||||
productName: pq.product.name,
|
||||
printerType: pq.product.printerType,
|
||||
productVariantName: pq.variant?.name,
|
||||
quantity: pq.quantity,
|
||||
unitPrice: pq.product.price,
|
||||
totalPrice: (pq.product.price ?? 0) * (pq.quantity),
|
||||
);
|
||||
}).toList();
|
||||
onPrintSplit(
|
||||
context,
|
||||
order: order.copyWith(
|
||||
orderItems: updatedOrderItems,
|
||||
),
|
||||
);
|
||||
},
|
||||
child: const Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Icon(
|
||||
Icons.print_rounded,
|
||||
color: Colors.white,
|
||||
size: 20,
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(
|
||||
'Cetak Struk',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildSummaryFooter(Order order) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(24.0),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
colors: [
|
||||
Colors.grey.shade50,
|
||||
Colors.white,
|
||||
],
|
||||
),
|
||||
borderRadius: const BorderRadius.vertical(
|
||||
bottom: Radius.circular(24),
|
||||
),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
// Decorative Divider
|
||||
Container(
|
||||
height: 1,
|
||||
margin: const EdgeInsets.only(bottom: 20),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
Colors.transparent,
|
||||
AppColors.primary.withOpacity(0.3),
|
||||
Colors.transparent,
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
// Subtotal Row
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.shopping_cart_outlined,
|
||||
size: 16,
|
||||
color: Colors.grey.shade600,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Text(
|
||||
'Subtotal (${widget.productQuantity.length} items)',
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Colors.grey.shade600,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Text(
|
||||
widget.nominalBayar.currencyFormatRpV2,
|
||||
style: const TextStyle(
|
||||
fontSize: 14,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 16),
|
||||
|
||||
// Total Payment Row
|
||||
Container(
|
||||
padding: const EdgeInsets.all(16),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topLeft,
|
||||
end: Alignment.bottomRight,
|
||||
colors: [
|
||||
AppColors.primary.withOpacity(0.1),
|
||||
AppColors.primary.withOpacity(0.05),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
border: Border.all(
|
||||
color: AppColors.primary.withOpacity(0.2),
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
children: [
|
||||
Container(
|
||||
padding: const EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.primary.withOpacity(0.2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Icon(
|
||||
Icons.payments_rounded,
|
||||
size: 16,
|
||||
color: AppColors.primary,
|
||||
),
|
||||
),
|
||||
const SizedBox(width: 12),
|
||||
const Text(
|
||||
'Total Pembayaran',
|
||||
style: TextStyle(
|
||||
fontSize: 16,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 12,
|
||||
vertical: 6,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [
|
||||
AppColors.primary,
|
||||
AppColors.primary.withOpacity(0.8),
|
||||
],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.3),
|
||||
blurRadius: 4,
|
||||
offset: const Offset(0, 2),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
widget.nominalBayar.currencyFormatRpV2,
|
||||
style: const TextStyle(
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Colors.white,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user