resolvePeek static method
bool
resolvePeek({
- required bool? enablePeek,
- required Set<
GlassSheetDetent> detents, - 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:
enablePeekwhen set explicitly — deprecated, but an existing caller's intent must keep winning.- GlassSheetDetent.small in
detents— the current way. - 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);