PublicUserInfo.fromMap constructor
PublicUserInfo.fromMap(
- Map<String, dynamic> map
)
Implementation
PublicUserInfo.fromMap(Map<String, dynamic> map)
: email = map['email'] ?? map['email'],
emailVerified = map['emailVerified'] ?? map['email_verified'],
id = map['id'] ?? map['id'],
phone = map['phone'] ?? map['phone'],
phoneVerified = map['phoneVerified'] ?? map['phone_verified'],
status = UserStatus.values.firstWhere(
(e) => e.value == (map['status'] ?? map['status']),
orElse: () => UserStatus.statusUnavailable),
userMetadata = map['userMetadata'] ?? map['user_metadata'],
webauthn = map['webauthn'] ?? map['webauthn'],
webauthnTypes = (map['webauthnTypes'] ?? map['webauthn_types']) != null
? List<WebAuthnType>.from((map['webauthnTypes'] ?? map['webauthn_types'])
.map((type) => WebAuthnType.values.firstWhere(
(e) => e.value == type,
orElse: () => WebAuthnType.passkey)))
: null;