hasHeart method Null safety

bool hasHeart()

Returns true if the rating is "heart selected" or false if the rating is "heart unselected", if the rating style is not RatingStyle.heart or if it is unrated.

Implementation

bool hasHeart() {
  if (_type != RatingStyle.heart) return false;
  return _value as bool? ?? false;
}