formattazione testo da e verso json
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flux/core/utils/string_extensions.dart';
|
||||
|
||||
class CustomerModel extends Equatable {
|
||||
final String? id; // Bigint in SQL
|
||||
@@ -81,7 +82,7 @@ class CustomerModel extends Equatable {
|
||||
createdAt: json['created_at'] != null
|
||||
? DateTime.parse(json['created_at'])
|
||||
: null,
|
||||
nome: json['nome'],
|
||||
nome: (json['nome'] as String).myFormat(),
|
||||
telefono: json['telefono'],
|
||||
email: json['email'],
|
||||
note: json['note'] ?? '',
|
||||
@@ -98,9 +99,9 @@ class CustomerModel extends Equatable {
|
||||
Map<String, dynamic> toJson() {
|
||||
return {
|
||||
if (id != null) 'id': id,
|
||||
'nome': nome,
|
||||
'nome': nome.toLowerCase(),
|
||||
'telefono': telefono,
|
||||
'email': email,
|
||||
'email': email.toLowerCase(),
|
||||
'note': note,
|
||||
if (dataUltimoContatto != null)
|
||||
'data_ultimo_contatto': dataUltimoContatto!.toIso8601String(),
|
||||
|
||||
Reference in New Issue
Block a user