fromJson static method

LeadCoApplicantInformationJson? fromJson(
  1. dynamic value
)

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

Implementation

// ignore: prefer_constructors_over_static_methods
static LeadCoApplicantInformationJson? fromJson(dynamic value) {
  if (value is Map) {
    final json = value.cast<String, dynamic>();

    // Ensure that the map contains the required keys.
    // Note 1: the values aren't checked for validity beyond being non-null.
    // Note 2: this code is stripped in release mode!
    assert(() {
      return true;
    }());

    return LeadCoApplicantInformationJson(
      firstName: mapValueOfType<String>(json, r'firstName'),
      lastName: mapValueOfType<String>(json, r'lastName'),
      dateOfBirth: mapDateTime(json, r'dateOfBirth', r''),
      annualIncome: mapValueOfType<int>(json, r'annualIncome'),
      streetAddress1: mapValueOfType<String>(json, r'streetAddress1'),
      streetAddress2: mapValueOfType<String>(json, r'streetAddress2'),
      city: mapValueOfType<String>(json, r'city'),
      state: State.fromJson(json[r'state']),
      zipcode: mapValueOfType<String>(json, r'zipcode'),
    );
  }
  return null;
}