fromWidth static method

NiceBreakpoint fromWidth(
  1. double width
)

Get current breakpoint from width

Implementation

static NiceBreakpoint fromWidth(double width) {
  if (width >= xxl) return NiceBreakpoint.xxl;
  if (width >= xl) return NiceBreakpoint.xl;
  if (width >= lg) return NiceBreakpoint.lg;
  if (width >= md) return NiceBreakpoint.md;
  if (width >= sm) return NiceBreakpoint.sm;
  return NiceBreakpoint.xs;
}