fromJson static method

AddressModel fromJson(
  1. dynamic value
)

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

Implementation

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

  return AddressModel(
    street: mapValueOfType<String>(json, r'street'),
    postalCode: mapValueOfType<String>(json, r'postalCode'),
    city: mapValueOfType<String>(json, r'city'),
  );
}