toModel static method

EchatUserInfo? toModel({
  1. required Map<String, Object>? data,
})

Implementation

static EchatUserInfo? toModel({required Map<String, Object>? data}) {
  if (data == null) {
    return null;
  }
  var userInfo = EchatUserInfo(uid: "");
  var uid = data["uid"] as String?;
  if (uid != null) {
    userInfo.uid = uid;
  }
  userInfo.vip = data["vip"] as int;
  userInfo.grade = data["grade"] as String?;
  userInfo.category = data["category"] as String?;
  userInfo.name = data["name"] as String?;
  userInfo.nickName = data["nickName"] as String?;
  userInfo.gender = data["gender"] as int?;
  userInfo.age = data["age"] as int?;
  userInfo.birthday = data["birthday"] as String?;
  userInfo.maritalStatus = data["maritalStatus"] as int?;
  userInfo.phone = data["phone"] as String?;
  userInfo.qq = data["qq"] as String?;
  userInfo.wechat = data["wechat"] as String?;
  userInfo.email = data["email"] as String?;
  userInfo.nation = data["nation"] as String?;
  userInfo.province = data["province"] as String?;
  userInfo.city = data["city"] as String?;
  userInfo.address = data["address"] as String?;
  userInfo.photo = data["photo"] as String?;
  userInfo.memo = data["memo"] as String?;

  userInfo.c1 = data["c1"] as String?;
  userInfo.c2 = data["c2"] as String?;
  userInfo.c3 = data["c3"] as String?;
  userInfo.c4 = data["c4"] as String?;
  userInfo.c5 = data["c5"] as String?;
  userInfo.c6 = data["c6"] as String?;
  userInfo.c8 = data["c8"] as String?;
  userInfo.c9 = data["c9"] as String?;
  userInfo.c10 = data["c10"] as String?;
  userInfo.c11 = data["c11"] as String?;
  userInfo.c12 = data["c12"] as String?;
  userInfo.c13 = data["c13"] as String?;
  userInfo.c14 = data["c14"] as String?;
  userInfo.c15 = data["c15"] as String?;
  userInfo.c16 = data["c16"] as String?;
  userInfo.c17 = data["c17"] as String?;
  userInfo.c18 = data["c18"] as String?;
  userInfo.c19 = data["c19"] as String?;
  userInfo.c20 = data["c20"] as String?;

  return userInfo;
}