classify function

  1. @visibleForTesting
DeviceSize classify(
  1. double width
)

Classifies a window width (logical px) into a DeviceSize.

Ordered desktop → tablet → mobile, assuming ascending Breakpoints (tablet < desktop):

Exposed only for direct unit testing (visibleForTesting); it is not part of the public package surface (the barrel's show clause excludes it). Production code reads the class through ResponsiveScope / ResponsiveContext, never by calling this directly.

Implementation

@visibleForTesting
DeviceSize classify(double width) {
  if (width >= Breakpoints.desktop) return DeviceSize.desktop;
  if (width >= Breakpoints.tablet) return DeviceSize.tablet;
  return DeviceSize.mobile;
}