UserModel constructor
UserModel({
- ObjectType type = ObjectType.user,
- Map<
String, dynamic> ? userData, - bool logout = false,
Implementation
UserModel(
{ObjectType type = ObjectType.user, Map<String, dynamic>? userData, bool logout = false})
: super(type: type) {
if (logout || userData == null) {
return;
}
if (userData.isEmpty) {
return;
}
String userId = userData['userId'] ?? '';
if (userId.isEmpty) {
return;
}
String guestUserId = myConfig?.serverConfig.guestUserId ?? '';
if (guestUserId.isNotEmpty && guestUserId == userData['email']) {
_isGuestUser = true;
} else {
_isLoginedUser = true;
}
fromMap(userData);
}