resolve static method

PrismBreakpoint resolve(
  1. double width, {
  2. double compact = 0,
  3. double mediumWidth = 600,
  4. double expanded = 840,
  5. double extraLarge = 1200,
})

Resolves which window class width falls into, using token-driven thresholds when they are supplied.

Pass PrismTokens.of(context) values so an app can retune what counts as compact without forking the widget.

Implementation

static PrismBreakpoint resolve(
  double width, {
  double compact = 0,
  double mediumWidth = 600,
  double expanded = 840,
  double extraLarge = 1200,
}) {
  if (width >= extraLarge) return PrismBreakpoint(extraLarge);
  if (width >= expanded) return PrismBreakpoint(expanded);
  if (width >= mediumWidth) return PrismBreakpoint(mediumWidth);
  return PrismBreakpoint(compact);
}