Profile.fromJson constructor
The default constructor.
Implementation
factory Profile.fromJson(Map<String, dynamic> json) {
final List<dynamic>? certs = json['certifications'] as List<dynamic>?;
final List<dynamic>? education = json['education'] as List<dynamic>?;
final List<dynamic>? favorites = json['favorites'] as List<dynamic>?;
final Map<String, dynamic>? lastLoginLocation =
json['lastLoginLocation'] as Map<String, dynamic>?;
final List<dynamic>? likes = json['likes'] as List<dynamic>?;
final Map<String, dynamic>? oidcStruct =
json['oidcData'] as Map<String, dynamic>?;
final List<dynamic>? patents = json['patents'] as List<dynamic>?;
final List<dynamic>? phones = json['phones'] as List<dynamic>?;
final List<dynamic>? publications = json['publications'] as List<dynamic>?;
final List<dynamic>? skills = json['skills'] as List<dynamic>?;
final List<dynamic>? work = json['work'] as List<dynamic>?;
return Profile._(
activities: json['activities'] as String?,
address: json['address'] as String?,
age: json['age'] as int?,
bio: json['bio'] as String?,
birthDay: json['birthDay'] as int?,
birthMonth: json['birthMonth'] as int?,
birthYear: json['birthYear'] as int?,
certifications:
_listFromJson<Certification>(certs, Certification.fromJson),
city: json['city'] as String?,
country: json['country'] as String?,
education: _listFromJson<Education>(education, Education.fromJson),
educationLevel: json['educationLevel'] as String?,
email: json['email'] as String?,
favorites: _listFromJson<Favorite>(favorites, Favorite.fromJson),
firstName: json['firstName'] as String?,
followers: json['followersCounts'] as int?,
following: json['followingCount'] as int?,
gender: json['gender'] as String?,
hometown: json['hometown'] as String?,
honors: json['honors'] as String?,
industry: json['industry'] as String?,
interests: json['interests'] as String?,
languages: json['languages'] as String?,
lastLoginLocation: lastLoginLocation == null
? null
: Location.fromJson(lastLoginLocation),
lastName: json['lastName'] as String?,
likes: _listFromJson<Like>(likes, Like.fromJson),
locale: json['locale'] as String?,
name: json['name'] as String?,
nickname: json['nickname'] as String?,
oidcData: oidcStruct == null ? null : OidcData.fromJson(oidcStruct),
patents: _listFromJson<Patent>(patents, Patent.fromJson),
phones: _listFromJson<Phone>(phones, Phone.fromJson),
photoUrl: json['photoURL'] as String?,
politicalView: json['politicalView'] as String?,
professionalHeadline: json['professionalHeadline'] as String?,
profileUrl: json['profileURL'] as String?,
proxyEmail: json['proxyEmail'] as String?,
publications:
_listFromJson<Publication>(publications, Publication.fromJson),
relationshipStatus: json['relationshipStatus'] as String?,
religion: json['religion'] as String?,
skills: _listFromJson<Skill>(skills, Skill.fromJson),
specialities: json['specialities'] as String?,
state: json['state'] as String?,
thumbnailUrl: json['thumbnailURL'] as String?,
timezone: json['timezone'] as String?,
username: json['username'] as String?,
verified: json['verified'] as String?,
work: _listFromJson<Work>(work, Work.fromJson),
zip: json['zip'] as String?,
);
}