estimateCarpetExtent property

double get estimateCarpetExtent

Estimates the total carpet height including unknowns.

Sums known heights with averaged unknowns, plus spacing, for viewport calculations in Carpet.

Implementation

double get estimateCarpetExtent {
  double avgUnknown = averageQuiltHeight;

  return quiltHeights.map((i) => i > 0 ? i : avgUnknown).sum() +
      (quiltHeights.length > 1
          ? (quiltHeights.length - 1) * style.spacing
          : 0);
}