previousMentionedContains method Null safety

bool previousMentionedContains(
  1. User user
)

Implementation

bool previousMentionedContains(User user) {
  if (oldValues == null || oldValues?['mentioned_user_ids'] == null) {
    return false;
  }
  List<String> previous = oldValues?['mentioned_user_ids'];
  return previous.contains(user.userId);
}