User.fromJson constructor
Parse from a json
Implementation
factory User.fromJson(Map<String, dynamic> json) => User(
id: json['id'],
firstName: json['first_name'],
lastName: json['last_name'],
username: json['username'],
phoneNumber: json['phone_number'],
status: UserStatus.fromJson(json['status']),
profilePhoto: json['profile_photo'] == null ? null : ProfilePhoto.fromJson(json['profile_photo']),
isContact: json['is_contact'],
isMutualContact: json['is_mutual_contact'],
isVerified: json['is_verified'],
isSupport: json['is_support'],
restrictionReason: json['restriction_reason'],
isScam: json['is_scam'],
isFake: json['is_fake'],
haveAccess: json['have_access'],
type: UserType.fromJson(json['type']),
languageCode: json['language_code'],
extra: json['@extra'],
clientId: json['@client_id'],
);