StarRating.parse constructor

StarRating.parse(
  1. XmlElement? element
)

Parse constructor for the StarRating class, used when 'parsing' a feed

Implementation

factory StarRating.parse(XmlElement? element) => StarRating(
      average: double.tryParse(element?.getAttribute('average') ?? '0'),
      count: int.tryParse(element?.getAttribute('count') ?? '0'),
      min: int.tryParse(element?.getAttribute('min') ?? '0'),
      max: int.tryParse(element?.getAttribute('max') ?? '0'),
    );