dismissPivotState static method

GlassSheetState dismissPivotState(
  1. SheetGeometry geometry
)

The detent a swipe-to-dismiss drag falls away from.

Mirrors the pivot _calculateMetrics drags from: the peek floor when there is one, otherwise the lowest enabled visible detent.

Deliberately not SheetGeometry.minState, which is GlassSheetState.hidden for the common dismissible peek-less sheet — hidden is the position a swipe drags the sheet to, and measuring travel from it would read every drag as zero.

Implementation

static GlassSheetState dismissPivotState(SheetGeometry geometry) =>
    geometry.orderedStates.firstWhere(
      (state) => state != GlassSheetState.hidden,
    );