User.fromUserInfo constructor

User.fromUserInfo(
  1. UserInfo userInfo
)

Implementation

factory User.fromUserInfo(UserInfo userInfo) {
  return User(
    subject: userInfo.subject,
    name: userInfo.name,
    givenName: userInfo.givenName,
    familyName: userInfo.familyName,
    middleName: userInfo.middleName,
    nickname: userInfo.nickname,
    preferredUsername: userInfo.preferredUsername,
    profile: userInfo.profile,
    picture: userInfo.picture,
    website: userInfo.website,
    email: userInfo.email,
    emailVerified: userInfo.emailVerified,
    gender: userInfo.gender,
    birthdate: userInfo.birthdate,
    zoneinfo: userInfo.zoneinfo,
    locale: userInfo.locale,
    phoneNumber: userInfo.phoneNumber,
    phoneNumberVerified: userInfo.phoneNumberVerified,
    formattedAddress:
        (userInfo.address != null) ? userInfo.address!.formatted : null,
    streetAddress:
        (userInfo.address != null) ? userInfo.address!.streetAddress : null,
    locality: (userInfo.address != null) ? userInfo.address!.locality : null,
    region: (userInfo.address != null) ? userInfo.address!.region : null,
    postalCode:
        (userInfo.address != null) ? userInfo.address!.postalCode : null,
    country: (userInfo.address != null) ? userInfo.address!.country : null,
    updatedAt: userInfo.updatedAt,
  );
}