User.fromJson constructor

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

Parse from a json

Implementation

User.fromJson(Map<String, dynamic> json) {
  this.id = json['id'];
  this.firstName = json['first_name'];
  this.lastName = json['last_name'];
  this.username = json['username'];
  this.phoneNumber = json['phone_number'];
  this.status = UserStatus.fromJson(json['status'] ?? <String, dynamic>{});
  this.profilePhoto =
      ProfilePhoto.fromJson(json['profile_photo'] ?? <String, dynamic>{});
  this.isContact = json['is_contact'];
  this.isMutualContact = json['is_mutual_contact'];
  this.isVerified = json['is_verified'];
  this.isSupport = json['is_support'];
  this.restrictionReason = json['restriction_reason'];
  this.isScam = json['is_scam'];
  this.haveAccess = json['have_access'];
  this.type = UserType.fromJson(json['type'] ?? <String, dynamic>{});
  this.languageCode = json['language_code'];
  this.extra = json['@extra'];
}