UserData.fromJson constructor

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

Implementation

factory UserData.fromJson(Map<String, dynamic> json) {
  return UserData(
    username: json['data']['matchedUser']['username'] ?? '',
    name: json['data']['matchedUser']['profile']['realName'] ?? '',
    birthday: json['data']['matchedUser']['profile']['birthday'] ?? '',
    avatar: json['data']['matchedUser']['profile']['userAvatar'] ?? '',
    ranking: json['data']['matchedUser']['profile']['ranking'] ?? 0,
    reputation: json['data']['matchedUser']['profile']['reputation'] ?? 0,
    gitHub: json['data']['matchedUser']['githubUrl'] ?? '',
    twitter: json['data']['matchedUser']['twitterUrl'] ?? '',
    linkedIN: json['data']['matchedUser']['linkedinUrl'] ?? '',
    websites: List<String>.from(json['data']['matchedUser']['profile']['websites'] ?? []),
    country: json['data']['matchedUser']['profile']['country'] ?? '',
    company: json['data']['matchedUser']['profile']['company'] ??'',
    school: json['data']['matchedUser']['profile']['school'] ?? '',
    contributionsPoints:json['data']['matchedUser']['contributions']['points'] ?? 0 ,
    contributionsQuestionCount:json['data']['matchedUser']['contributions']['questionCount'] ?? 0 ,
    contributionsTestcaseCount:json['data']['matchedUser']['contributions']['testcaseCount'] ?? 0 ,
    starRating: json['data']['matchedUser']['profile']['starRating'] ?? 0.0 ,
    skillTags: List<String>.from(json['data']['matchedUser']['profile']['skillTags'] ?? []),
    about: json['data']['matchedUser']['profile']['about'] ?? '',
  );
}