toPublic method

UserInfoPublic toPublic({
  1. bool includeUserId = true,
  2. bool includeFullName = true,
})

Returns an object with only the information that can safely be shared publicly for the user.

Implementation

UserInfoPublic toPublic({
  bool includeUserId = true,
  bool includeFullName = true,
}) {
  return UserInfoPublic(
    id: includeUserId ? id : null,
    userName: userName,
    fullName: includeFullName ? fullName : null,
    created: created,
    imageUrl: imageUrl,
  );
}