ApperoRatingImages.fromList constructor

ApperoRatingImages.fromList(
  1. List<String> assetPaths
)

Creates rating images from a list of 5 asset paths.

The list must contain exactly 5 paths in order from lowest to highest rating.

Implementation

factory ApperoRatingImages.fromList(List<String> assetPaths) {
  if (assetPaths.length != 5) {
    throw ArgumentError('Rating images must contain exactly 5 asset paths');
  }
  return ApperoRatingImages(
    strongNegative: assetPaths[0],
    negative: assetPaths[1],
    neutral: assetPaths[2],
    positive: assetPaths[3],
    strongPositive: assetPaths[4],
  );
}