percentRating property

double percentRating

Returns a percentage rating value greater or equal to 0.0, or a negative value if the rating style is not percentage-based, or if it is unrated.

Implementation

double get percentRating {
  if (type != RatingStyleMessage.percentage) return -1;
  final localValue = value as double?;
  if (localValue == null || localValue < 0 || localValue > 100) return -1;
  return localValue;
}