compareAtPrice property
double
get
compareAtPrice
return the first product variant compareAtPrice amount or 0 if the list is empty
It is useful to show the compareAtPrice of the product in the product list
Implementation
double get compareAtPrice => productVariants.isEmpty
? 0
: (productVariants.first.compareAtPrice == null
? 0
: productVariants.first.compareAtPrice!.amount);