UserInfo.fromJSON constructor

UserInfo.fromJSON(
  1. dynamic json
)

Implementation

UserInfo.fromJSON(dynamic json)
    : sub = json["sub"],
      isAnonymous = json["https://authgear.com/claims/user/is_anonymous"],
      isVerified = json["https://authgear.com/claims/user/is_verified"],
      canReauthenticate =
          json["https://authgear.com/claims/user/can_reauthenticate"],
      roles = parseRoles(json["https://authgear.com/claims/user/roles"]),
      raw = json,
      customAttributes = json["custom_attributes"] ?? {},
      email = json["email"],
      emailVerified = json["email_verified"],
      phoneNumber = json["phone_number"],
      phoneNumberVerified = json["phone_number_verified"],
      preferredUsername = json["preferred_username"],
      familyName = json["family_name"],
      givenName = json["given_name"],
      middleName = json["middle_name"],
      name = json["name"],
      nickname = json["nickname"],
      picture = json["picture"],
      profile = json["profile"],
      website = json["website"],
      gender = json["gender"],
      birthdate = json["birthdate"],
      zoneinfo = json["zoneinfo"],
      locale = json["locale"],
      address = json["address"] != null
          ? UserInfoAddress.fromJSON(json["address"])
          : null;