fromJson static method

NewCustomerModel fromJson(
  1. dynamic value
)

Returns a new NewCustomerModel instance and imports its values from value if it's a Map, null otherwise.

Implementation

// ignore: prefer_constructors_over_static_methods
static NewCustomerModel fromJson(dynamic value) {
  final json = value.cast<String, dynamic>();

  return NewCustomerModel(
    name: mapValueOfType<String>(json, r'name')!,
    image: mapValueOfType<String>(json, r'image'),
    nif: mapValueOfType<String>(json, r'nif'),
    address: AddressModel.fromJson(json[r'address']),
    notes: mapValueOfType<String>(json, r'notes'),
    birthDate: mapDateTime(json, r'birthDate', r''),
    contactPerson1: ContactPersonModel.fromJson(json[r'contactPerson1']),
    contactPerson2: ContactPersonModel.fromJson(json[r'contactPerson2']),
  );
}