expandProgress property

double get expandProgress

Normalized progress between the half and full snap positions.

Returns 0.0 when at or below the half detent, and 1.0 when at the full detent. Used to drive the glass-to-solid color crossfade.

Implementation

double get expandProgress {
  final halfPos =
      SheetGeometry.positionFor(GlassSheetState.half, screenSize.height);
  final fullPos =
      SheetGeometry.positionFor(GlassSheetState.full, screenSize.height);
  if (fullPos <= halfPos) return 0.0;
  return ((position - halfPos) / (fullPos - halfPos)).clamp(0.0, 1.0);
}