resolvePeek static method

bool resolvePeek({
  1. required bool? enablePeek,
  2. required Set<GlassSheetDetent> detents,
  3. required GlassSheetMode mode,
})

Resolve whether the peek floor is active, from the public API's three inputs. Pure and static so the precedence is testable and reviewable in one place instead of inline in the widget's state.

Precedence:

  1. enablePeek when set explicitly — deprecated, but an existing caller's intent must keep winning.
  2. GlassSheetDetent.small in detents — the current way.
  3. GlassSheetMode.persistent, which is DEFINED by resting on a floor instead of dismissing, so it keeps peek under the default detents.

Implementation

static bool resolvePeek({
  required bool? enablePeek,
  required Set<GlassSheetDetent> detents,
  required GlassSheetMode mode,
}) =>
    enablePeek ??
    (detents.contains(GlassSheetDetent.small) ||
        mode == GlassSheetMode.persistent);