onScaleUpdate method

void onScaleUpdate(
  1. ScaleUpdateDetails event
)

Implementation

void onScaleUpdate(ScaleUpdateDetails event) {
  var scale = event.scale;
  if (this.scale == 0) {
    this.scale = scale;
    return;
  }
  scale /= this.scale;
  var itemWidth = previousItemWidth * scale;
  itemWidth = max(min(itemWidth, widget.maxItemWidth), widget.minItemWidth);
  scale = itemWidth / previousItemWidth;
  this.itemWidth.value = itemWidth;
  final offset =
      min(previousOffset * scale, data.length * itemWidth - maxWidth - 1e-2);
  scrollView.jumpTo(offset);
}