@@ -62,7 +62,7 @@ class _CustomerDetailScreenState extends State<CustomerDetailScreen> {
|
||||
backgroundColor: context.background,
|
||||
appBar: AppBar(
|
||||
title: Text(
|
||||
widget.customer.nome,
|
||||
widget.customer.name,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
backgroundColor: context.background,
|
||||
@@ -103,7 +103,7 @@ class _CustomerDetailScreenState extends State<CustomerDetailScreen> {
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
_infoTile(Icons.phone_android, "Telefono", widget.customer.telefono),
|
||||
_infoTile(Icons.phone_android, "Telefono", widget.customer.phoneNumber),
|
||||
_infoTile(
|
||||
Icons.email_outlined,
|
||||
"Email",
|
||||
@@ -117,7 +117,7 @@ class _CustomerDetailScreenState extends State<CustomerDetailScreen> {
|
||||
: widget.customer.note,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
if (widget.customer.nonDisturbare)
|
||||
if (widget.customer.doNotDisturb)
|
||||
Container(
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
@@ -191,8 +191,8 @@ class _CustomerDetailScreenState extends State<CustomerDetailScreen> {
|
||||
context: context,
|
||||
builder: (context) => QrUploadDialog(
|
||||
deepLinkUrl:
|
||||
'fluxapp://customer/${widget.customer.id}/upload?name=${Uri.encodeComponent(widget.customer.nome)}',
|
||||
title: 'Scatta per ${widget.customer.nome}',
|
||||
'fluxapp://customer/${widget.customer.id}/upload?name=${Uri.encodeComponent(widget.customer.name)}',
|
||||
title: 'Scatta per ${widget.customer.name}',
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -30,15 +30,15 @@ class _CustomerFormState extends State<CustomerForm> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
// Se widget.customer è null, i campi saranno vuoti
|
||||
_nomeController = TextEditingController(text: widget.customer?.nome ?? '');
|
||||
_nomeController = TextEditingController(text: widget.customer?.name ?? '');
|
||||
_telefonoController = TextEditingController(
|
||||
text: widget.customer?.telefono ?? '',
|
||||
text: widget.customer?.phoneNumber ?? '',
|
||||
);
|
||||
_emailController = TextEditingController(
|
||||
text: widget.customer?.email ?? '',
|
||||
);
|
||||
_noteController = TextEditingController(text: widget.customer?.note ?? '');
|
||||
_nonDisturbare = widget.customer?.nonDisturbare ?? false;
|
||||
_nonDisturbare = widget.customer?.doNotDisturb ?? false;
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -56,19 +56,19 @@ class _CustomerFormState extends State<CustomerForm> {
|
||||
// o creandone uno da zero, preservando l'ID in caso di modifica.
|
||||
final updatedCustomer =
|
||||
widget.customer?.copyWith(
|
||||
nome: _nomeController.text.trim(),
|
||||
telefono: _telefonoController.text.trim(),
|
||||
name: _nomeController.text.trim(),
|
||||
phoneNumber: _telefonoController.text.trim(),
|
||||
email: _emailController.text.trim(),
|
||||
note: _noteController.text.trim(),
|
||||
nonDisturbare: _nonDisturbare,
|
||||
doNotDisturb: _nonDisturbare,
|
||||
) ??
|
||||
CustomerModel(
|
||||
// Caso nuovo cliente
|
||||
nome: _nomeController.text.trim(),
|
||||
telefono: _telefonoController.text.trim(),
|
||||
name: _nomeController.text.trim(),
|
||||
phoneNumber: _telefonoController.text.trim(),
|
||||
email: _emailController.text.trim(),
|
||||
note: _noteController.text.trim(),
|
||||
nonDisturbare: _nonDisturbare,
|
||||
doNotDisturb: _nonDisturbare,
|
||||
companyId: '', // Verrà iniettato dal Bloc o dal chiamante
|
||||
);
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ class _CustomerSearchSheetState extends State<CustomerSearchSheet> {
|
||||
if (nuovoCliente != null) {
|
||||
operationsCubit.updateField(
|
||||
customerId: nuovoCliente.id,
|
||||
customerDisplayName: nuovoCliente.nome,
|
||||
customerDisplayName: nuovoCliente.name,
|
||||
);
|
||||
|
||||
setState(() {
|
||||
@@ -151,7 +151,7 @@ class _CustomerSearchSheetState extends State<CustomerSearchSheet> {
|
||||
final customer = state.customers[index];
|
||||
// Assumo che il tuo CustomerModel abbia le proprietà name e surname.
|
||||
// Adatta queste variabili al tuo modello reale!
|
||||
final displayName = customer.nome.trim();
|
||||
final displayName = customer.name.trim();
|
||||
|
||||
return ListTile(
|
||||
contentPadding: EdgeInsets.zero,
|
||||
|
||||
@@ -166,7 +166,7 @@ class _CustomerTile extends StatelessWidget {
|
||||
radius: 24,
|
||||
backgroundColor: context.accent.withValues(alpha: 0.1),
|
||||
child: Text(
|
||||
customer.nome.isNotEmpty ? customer.nome[0].toUpperCase() : '?',
|
||||
customer.name.isNotEmpty ? customer.name[0].toUpperCase() : '?',
|
||||
style: TextStyle(
|
||||
color: context.accent,
|
||||
fontWeight: FontWeight.bold,
|
||||
@@ -174,7 +174,7 @@ class _CustomerTile extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
title: Text(
|
||||
customer.nome,
|
||||
customer.name,
|
||||
style: const TextStyle(fontWeight: FontWeight.bold, fontSize: 16),
|
||||
),
|
||||
subtitle: Padding(
|
||||
@@ -184,7 +184,7 @@ class _CustomerTile extends StatelessWidget {
|
||||
Icon(Icons.phone_android, size: 14, color: context.secondaryText),
|
||||
const SizedBox(width: 4),
|
||||
Text(
|
||||
customer.telefono,
|
||||
customer.phoneNumber,
|
||||
style: TextStyle(color: context.secondaryText),
|
||||
),
|
||||
if (customer.email.isNotEmpty) ...[
|
||||
|
||||
Reference in New Issue
Block a user