validateUserOptions static method

bool validateUserOptions(
  1. User? loggedInUser,
  2. User? user,
  3. String id
)

Implementation

static bool validateUserOptions(User? loggedInUser, User? user, String id) {
  if (user?.uid == loggedInUser?.uid && id == UserOptionConstants.blockUser) {
    return false;
  } else if ((user?.blockedByMe == true) &&
      id == UserOptionConstants.blockUser) {
    return false;
  } else if ((user?.blockedByMe == false || user?.blockedByMe == null) &&
      id == UserOptionConstants.unblockUser) {
    return false;
  }

  return true;
}