shrinkBy method

void shrinkBy(
  1. double pixels
)

Implementation

void shrinkBy(double pixels) {
  double currentWidth = getContentWidth();
  double targetWidth = currentWidth - pixels.abs();
  double percentReduction = targetWidth / currentWidth;
  for (int i = 0; i < widths.length; i++)
    widths[i] = (widths[i]! * percentReduction).roundToDouble();
}