interpolation property

double get interpolation

Returns the current interpolation value, typically representing the progress between two states (e.g., expanded and collapsed) as a double between 0.0 and 1.0.

This value can be used for animations or to determine the visual state of the toggle sheet.

Implementation

double get interpolation {
  if (_extent.minHeight >= _extent.maxHeight) {
    return 1.0;
  }

  return lerpBetween(
    clampDouble(_extent.offset, _extent.minHeight, _extent.maxHeight),
    0.0,
    1.0,
    _extent.minHeight,
    _extent.maxHeight,
  );
}