valueOf<T> static method

T valueOf<T>(
  1. double width, {
  2. required T base,
  3. T? sm,
  4. T? md,
  5. T? lg,
  6. T? xl,
  7. T? xxl,
})

Returns the highest-matching size-specific value for width, or base if none match.

Implementation

static T valueOf<T>(
  double width, {
  required T base,
  T? sm,
  T? md,
  T? lg,
  T? xl,
  T? xxl,
}) {
  if (width >= ResponsiveBreakpoints.xxl && xxl != null) return xxl;
  if (width >= ResponsiveBreakpoints.xl && xl != null) return xl;
  if (width >= ResponsiveBreakpoints.lg && lg != null) return lg;
  if (width >= ResponsiveBreakpoints.md && md != null) return md;
  if (width >= ResponsiveBreakpoints.sm && sm != null) return sm;
  return base;
}