VkUser.fromJSON constructor

VkUser.fromJSON(
  1. dynamic accountGetProfileInfo,
  2. dynamic usersGet
)

accountGetProfileInfo is a response from account.getProfileInfo usersGet is a response from users.get with photo_50,photo_100,photo_200,photo_max_orig params

Implementation

VkUser.fromJSON(accountGetProfileInfo, usersGet) {

  this.id = accountGetProfileInfo['id'];
  this.photo50 = usersGet['photo_50'];
  this.photo100 = usersGet['photo_100'];
  this.photo200 = usersGet['photo_200'];
  this.photo = usersGet['photo_max_orig'];
  this.firstName = accountGetProfileInfo['first_name'];
  this.lastName = accountGetProfileInfo['last_name'];
  this.maidenName = accountGetProfileInfo['maiden_name'];
  this.screenName = accountGetProfileInfo['screen_name'];
  this.sex = accountGetProfileInfo['sex'];
  this.relation = accountGetProfileInfo['relation'];
  this.relationPartnerId = accountGetProfileInfo['relation_partner'] != null ? accountGetProfileInfo['relation_partner']['id'] : null;
  this.relationPending = accountGetProfileInfo['relation_pending'];
  this.birthDate = accountGetProfileInfo['bdate'];
  this.birthDateVisibility = accountGetProfileInfo['bdate_visibility'];
  this.countryId = accountGetProfileInfo['country'] != null ? accountGetProfileInfo['country']['id'] : null;
  this.countryTitle = accountGetProfileInfo['country'] != null ? accountGetProfileInfo['country']['title'] : null;
  this.homeTown = accountGetProfileInfo['home_town'];
  this.cityId = accountGetProfileInfo['city']?['id'];
  this.cityTitle = accountGetProfileInfo['city'] != null ? accountGetProfileInfo['city']['title'] : null;
  this.status = accountGetProfileInfo['status'];
  this.phone = accountGetProfileInfo['phone'];
}