User.fromJson constructor

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

Implementation

User.fromJson(Map<String, dynamic> json) : id = json['id'] {
  hasProfileImage = json['has_profile_image'];
  timelinePrivacy = json['timeline_privacy'];
  nickName = json['nick_name'];
  displayName = json['display_name'];
  dateOfBirth = json['date_of_birth'];
  avatar = json['avatar'];
  gender = json['gender'];
  karma = (json['karma'] is int) ? json['karma'].toDouble() : json['karma'];
  premium = json['premium'];
  enable2fa = json['enable_2fa'];
  verifiedAccount = json['verified_account'];
  dateformat = json['dateformat'];
  defaultLang = json['default_lang'];
  friendListPrivacy = json['friend_list_privacy'];
  nameColor = json['name_color'];
  fullName = json['full_name'];
  location = json['location'];
  timezone = json['timezone'];
  bdayPrivacy = json['bday_privacy'];
  plurksCount = json['plurks_count'];
  responseCount = json['response_count'];
  pinnedPlurkId =
  (json['pinned_plurk_id'] != null) ? json['pinned_plurk_id'] : null;
  backgroundId = json['background_id'];
  showAds = json['show_ads'];
  showLocation = json['show_location'];
  following = json['following'];
  settings = json['settings'];
  following_tl = json['following_tl'];
  following_im = json['following_im'];
  profileViews = json['profile_views'];
  avatarSmall = json['avatar_small'];
  avatarMedium = json['avatar_medium'];
  avatarBig = json['avatar_big'];
  about = json['about'];
  aboutRenderred = json['about_renderred'];
  pageTitle = json['page_title'];
  recruited = json['recruited'];
  relationship = json['relationship'];
  friendsCount = json['friends_count'];
  fansCount = json['fans_count'];
  joinDate = json['join_date'];
  privacy = json['privacy'];
  acceptPrivatePlurkFrom = json['accept_private_plurk_from'];
  postAnonymousPlurk = json['post_anonymous_plurk'];
  if (json['badges'] != null) {
    badges = [];
    List? badgeList = json['badges'];
    if (badgeList != null) {
      badgeList.forEach((element) {
        badges!.add(element);
      });
    }
  }
  linkFacebook = json['link_facebook'];
  setupFacebookSync = json['setup_facebook_sync'];
  setupTwitterSync = json['setup_twitter_sync'];
  setupWeiboSync = json['setup_weibo_sync'];
  filter =
  json['filter'] != null ? new Filter.fromJson(json['filter']) : null;
  anniversary = json['anniversary'] != null
      ? new Anniversary.fromJson(json['anniversary'])
      : null;
  followingCount = json['following_count'];
  creature = json['creature'];
  creatureUrl = json['creature_url'];
  creatureSpecial = json['creature_special'];
  creatureSpecialUrl = json['creature_special_url'];
  email = json['email'];
  emailConfirmed = json['email_confirmed'];
  uid = json['uid'];
  errorText = json['error_text'];
  successText = json['success_text'];
}