From 174fdddb8a67cf8551fc1ee8831c0014f6b8c234 Mon Sep 17 00:00:00 2001 From: Suriya Date: Sat, 1 Aug 2026 12:43:05 +0530 Subject: [PATCH] Wire the dead Add customer button to the existing capture sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Customers module's primary action did nothing. The sheet it needed was already built and in use at checkout, so this reuses it — a customer added from the book now goes through the same validation, including the duplicate-mobile guard. Co-Authored-By: Claude Opus 5 --- lib/presentation/modules/screens/customers_view.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/presentation/modules/screens/customers_view.dart b/lib/presentation/modules/screens/customers_view.dart index e489a62..c18fed8 100644 --- a/lib/presentation/modules/screens/customers_view.dart +++ b/lib/presentation/modules/screens/customers_view.dart @@ -7,6 +7,7 @@ import '../../../core/theme/app_dimens.dart'; import '../../../core/utils/formatters.dart'; import '../../../core/widgets/status_pill.dart'; import '../../../domain/entities/customer.dart'; +import '../../customer/widgets/customer_capture_sheet.dart'; import '../widgets/module_widgets.dart'; /// Full customer book, independent of the six shown during billing. @@ -108,7 +109,13 @@ class _CustomersViewState extends ConsumerState { title: 'Customer book', subtitle: '${filtered.length} shown', action: FilledButton.icon( - onPressed: () {}, + // Reuses the sheet the till already opens at checkout, so a + // customer added here is validated the same way — including the + // duplicate-mobile guard. + onPressed: () async { + await showCustomerCaptureSheet(context); + ref.invalidate(allCustomersProvider); + }, icon: const Icon(Icons.person_add_alt_1_rounded, size: 17), label: const Text('Add customer'), style: FilledButton.styleFrom(