fromJson static method

User fromJson(
  1. dynamic json
)

Implementation

static User fromJson(dynamic json) {
  if (json == null) return User.init();

  return User(
    uid: json['uid'],
    username: json['username'],
    nickname: json['nickname'],
    email: json['email'],
    mobile: json['mobile'],
    avatar: json['avatar'],
    description: json['description'],
    platform: json['platform'],
    enabled: json['enabled'],
    superUser: json['superUser'],
    emailVerified: json['emailVerified'],
    mobileVerified: json['mobileVerified'],
    //
    currentOrganization: json['currentOrganization'] != null
        ? Organiztion.fromJson(json['currentOrganization'])
        : Organiztion.init(),
  );
}