From b173654a9c859880223aac3035840a9a67de1313 Mon Sep 17 00:00:00 2001 From: Efril Date: Mon, 27 Apr 2026 17:28:34 +0700 Subject: [PATCH] update print ui and report dashboard --- lib/presentation/components/print/print_ui.dart | 14 +++++++------- .../dashboard/report_dashboard_sales_chart.dart | 7 ++++--- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/presentation/components/print/print_ui.dart b/lib/presentation/components/print/print_ui.dart index 37d1e36..f3c1d79 100644 --- a/lib/presentation/components/print/print_ui.dart +++ b/lib/presentation/components/print/print_ui.dart @@ -36,7 +36,7 @@ class PrintUi { bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, paymentMethod: order.payments.last.paymentMethodName, tableNumber: order.tableNumber, @@ -103,7 +103,7 @@ class PrintUi { bytes += builder.dateTime(DateTime.now()); bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, paymentMethod: order.payments.isEmpty ? '' @@ -159,7 +159,7 @@ class PrintUi { bytes += builder.dateTime(DateTime.now()); bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, tableNumber: order.tableNumber, ); @@ -210,7 +210,7 @@ class PrintUi { bytes += builder.dateTime(DateTime.now()); bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, tableNumber: order.tableNumber, ); @@ -304,7 +304,7 @@ class PrintUi { bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, paymentMethod: order.payments.isEmpty ? null @@ -370,7 +370,7 @@ class PrintUi { bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, paymentMethod: order.payments.isEmpty ? null @@ -435,7 +435,7 @@ class PrintUi { bytes += builder.orderInfo( orderNumber: order.orderNumber, - customerName: order.metadata['customer_name'] ?? 'John Doe', + customerName: order.metadata['customer_name'] ?? '-', cashierName: cashierName, paymentMethod: order.payments.isEmpty ? null diff --git a/lib/presentation/pages/main/pages/report/widgets/dashboard/report_dashboard_sales_chart.dart b/lib/presentation/pages/main/pages/report/widgets/dashboard/report_dashboard_sales_chart.dart index 7ac6c24..1e0c982 100644 --- a/lib/presentation/pages/main/pages/report/widgets/dashboard/report_dashboard_sales_chart.dart +++ b/lib/presentation/pages/main/pages/report/widgets/dashboard/report_dashboard_sales_chart.dart @@ -109,9 +109,10 @@ class ReportDashboardSalesChart extends StatelessWidget { bottomTitles: AxisTitles( sideTitles: SideTitles( showTitles: true, - interval: - (maxX - minX) / - (sortedSales.length > 6 ? 6 : sortedSales.length), + interval: sortedSales.length <= 1 + ? 1 + : (maxX - minX) / + (sortedSales.length > 6 ? 6 : sortedSales.length), getTitlesWidget: (value, meta) { final date = DateTime.fromMillisecondsSinceEpoch( value.toInt(),