CustomerModel.fromMap constructor

CustomerModel.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory CustomerModel.fromMap(Map<String, dynamic> map) {
  return CustomerModel(
    id: map['id'],
    email: map['email'],
    name: map['name'],
    notes: map['notes'],
    createdAt: map['created_at'],
    updatedAt: map['updated_at'],
    customVariables: List<CustomVariables>.from(map['custom_variables']?.map((x) => CustomVariables.fromMap(x))),
    zipCode: map['zip_code'],
    number: map['number'] != null
        ? map['number'] is String
            ? int.parse(map['number'])
            : map['number']
        : null,
    complement: map['complement'],
    cpfCnpj: map['cpf_cnpj'],
  );
}