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:
@@ -7,6 +7,7 @@ import '../../../core/theme/app_dimens.dart';
|
|||||||
import '../../../core/utils/formatters.dart';
|
import '../../../core/utils/formatters.dart';
|
||||||
import '../../../core/widgets/status_pill.dart';
|
import '../../../core/widgets/status_pill.dart';
|
||||||
import '../../../domain/entities/customer.dart';
|
import '../../../domain/entities/customer.dart';
|
||||||
|
import '../../customer/widgets/customer_capture_sheet.dart';
|
||||||
import '../widgets/module_widgets.dart';
|
import '../widgets/module_widgets.dart';
|
||||||
|
|
||||||
/// Full customer book, independent of the six shown during billing.
|
/// Full customer book, independent of the six shown during billing.
|
||||||
@@ -108,7 +109,13 @@ class _CustomersViewState extends ConsumerState<CustomersView> {
|
|||||||
title: 'Customer book',
|
title: 'Customer book',
|
||||||
subtitle: '${filtered.length} shown',
|
subtitle: '${filtered.length} shown',
|
||||||
action: FilledButton.icon(
|
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),
|
icon: const Icon(Icons.person_add_alt_1_rounded, size: 17),
|
||||||
label: const Text('Add customer'),
|
label: const Text('Add customer'),
|
||||||
style: FilledButton.styleFrom(
|
style: FilledButton.styleFrom(
|
||||||
|
|||||||
Reference in New Issue
Block a user