fromJson static method
Returns a new LeadMortgageInformationJson instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static LeadMortgageInformationJson? 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 LeadMortgageInformationJson(
propertyType: PropertyType.fromJson(json[r'propertyType']),
propertyValue: mapValueOfType<int>(json, r'propertyValue'),
mortgageBalance: mapValueOfType<int>(json, r'mortgageBalance'),
lenderName: mapValueOfType<String>(json, r'lenderName'),
hasFHALoan: mapValueOfType<bool>(json, r'hasFHALoan'),
currentWithLoan: mapValueOfType<bool>(json, r'currentWithLoan'),
propertyStatus: PropertyStatus.fromJson(json[r'propertyStatus']),
mortgageType: MortgageType.fromJson(json[r'mortgageType']),
mortgageAmount: mapValueOfType<int>(json, r'mortgageAmount'),
downPaymentAmount: mapValueOfType<int>(json, r'downPaymentAmount'),
propertyState: mapValueOfType<String>(json, r'propertyState'),
propertyCounty: mapValueOfType<String>(json, r'propertyCounty'),
propertyAddress1: mapValueOfType<String>(json, r'propertyAddress1'),
propertyAddress2: mapValueOfType<String>(json, r'propertyAddress2'),
propertyZipcode: mapValueOfType<String>(json, r'propertyZipcode'),
propertyCity: mapValueOfType<String>(json, r'propertyCity'),
refinanceAmount: mapValueOfType<int>(json, r'refinanceAmount'),
cashOutAmount: mapValueOfType<int>(json, r'cashOutAmount'),
occupancyType: OccupancyType.fromJson(json[r'occupancyType']),
refinanceType: RefinanceType.fromJson(json[r'refinanceType']),
propertySearchStatus:
PropertySearchStatus.fromJson(json[r'propertySearchStatus']),
numUnits: mapValueOfType<int>(json, r'numUnits'),
closingDate: mapDateTime(json, r'closingDate', r''),
purchaseStatus: PurchaseStatus.fromJson(json[r'purchaseStatus']),
purchaseDate: mapDateTime(json, r'purchaseDate', r''),
monthlyHoaFee: num.parse('${json[r'monthlyHoaFee']}'),
mortgageCompany: mapValueOfType<String>(json, r'mortgageCompany'),
mortgageEscrowAmount: num.parse('${json[r'mortgageEscrowAmount']}'),
includeFhaLoans: mapValueOfType<bool>(json, r'includeFhaLoans'),
includeVaLoans: mapValueOfType<bool>(json, r'includeVaLoans'),
requestedLoanTerms:
MortgageLoanType.listFromJson(json[r'requestedLoanTerms']),
mortechCreditRating:
MortechCreditRating.fromJson(json[r'mortechCreditRating']),
);
}
return null;
}