responsiveValue<T> method
T
responsiveValue<T>({
- required T xs,
- T? sm,
- T? md,
- T? lg,
- T? xl,
Returns a value based on the current breakpoint.
Implementation
T responsiveValue<T>({required T xs, T? sm, T? md, T? lg, T? xl}) {
if (isXs) return xs;
if (isSm) return sm ?? xs;
if (isMd) return md ?? sm ?? xs;
if (isLg) return lg ?? md ?? sm ?? xs;
if (isXl) return xl ?? lg ?? md ?? sm ?? xs;
return xs; // fallback
}