Wire the dead Add customer button to the existing capture sheet

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 <noreply@anthropic.com>
This commit is contained in:
Suriya
2026-08-01 12:43:05 +05:30
parent 33467e6963
commit 174fdddb8a

View File

@@ -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<CustomersView> {
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(