AgentModel.fromJson constructor

AgentModel.fromJson(
  1. Map<String, dynamic> json
)

Implementation

AgentModel.fromJson(Map<String, dynamic> json) {
  if (json["id"] is int) id = json["id"];
  if (json["displayName"] is String) displayName = json["displayName"];
  if (json["firstName"] is String) firstName = json["firstName"];
  if (json["lastName"] is String) lastName = json["lastName"];
  if (json["email"] is String) email = json["email"];
  if (json["phone"] is String) phone = json["phone"];
  if (json["thumbnail"] is String) thumbnail = json["thumbnail"];
  if (json["countryCode"] is String) countryCode = json["countryCode"];
  if (json["zip"] is String) zip = json["zip"];
  if (json["mainLanguage"] is String) {
    mainLanguage = json["mainLanguage"];
  }
  if (json["secondaryLanguages"] is List) {
    secondaryLanguages = json["secondaryLanguages"] == null
        ? null
        : List<String>.from(json["secondaryLanguages"]);
  }
  if (json["problemType"] is Map) {
    problemType = json["problemType"] == null
        ? null
        : _ProblemType.fromJson(json["problemType"]);
  }
}