resolveFor method

int? resolveFor(
  1. double width
)

Resolves the active column span for a given layout width.

Uses a mobile-first approach where larger matching breakpoints take precedence. Returns null if no explicit span is configured (indicates auto-width).

Implementation

int? resolveFor(double width) {
  int? result = xs;
  if (width >= BsBreakpoints.sm && sm != null) result = sm;
  if (width >= BsBreakpoints.md && md != null) result = md;
  if (width >= BsBreakpoints.lg && lg != null) result = lg;
  if (width >= BsBreakpoints.xl && xl != null) result = xl;
  if (width >= BsBreakpoints.xxl && xxl != null) result = xxl;
  return result;
}