UserProfile.fromMap constructor
UserProfile.fromMap(
- Map<String, dynamic> result
)
Implementation
factory UserProfile.fromMap(final Map<String, dynamic> result) => UserProfile(
sub: result['sub'] as String,
name: result['name'] as String?,
givenName: result['given_name'] as String?,
familyName: result['family_name'] as String?,
middleName: result['middle_name'] as String?,
nickname: result['nickname'] as String?,
preferredUsername: result['preferred_username'] as String?,
profileUrl: result['profile'] != null
? Uri.parse(result['profile'] as String)
: null,
pictureUrl: result['picture'] != null
? Uri.parse(result['picture'] as String)
: null,
websiteUrl: result['website'] != null
? Uri.parse(result['website'] as String)
: null,
email: result['email'] as String?,
isEmailVerified: result['email_verified'] as bool?,
gender: result['gender'] as String?,
birthdate: result['birthdate'] as String?,
zoneinfo: result['zoneinfo'] as String?,
locale: result['locale'] as String?,
phoneNumber: result['phone_number'] as String?,
isPhoneNumberVerified: result['phone_number_verified'] as bool?,
address: result['address'] != null
? Map<String, String>.from(
result['address'] as Map<dynamic, dynamic>)
: null,
updatedAt: result['updated_at'] != null
? DateTime.parse(result['updated_at'] as String)
: null,
customClaims: result['custom_claims'] != null
? Map<String, dynamic>.from(
result['custom_claims'] as Map<dynamic, dynamic>)
: null,
);