byWidth<T> static method

T byWidth<T>(
  1. dynamic context,
  2. T size, {
  3. T? computer,
  4. T? computerSmall2,
  5. T? computerSmall,
  6. T? largeTablet,
  7. T? tablet,
  8. T? phone,
  9. T? tiny,
})

Implementation

static T byWidth<T>(context, T size,
    {T? computer,
    T? computerSmall2,
    T? computerSmall,
    T? largeTablet,
    T? tablet,
    T? phone,
    T? tiny}) {
  if (isComputerSmall2(context)) return computerSmall2 ?? size;
  if (isComputerSmall(context)) return computerSmall ?? size;
  if (isComputer(context)) return computer ?? size;
  if (isLargeTablet(context)) return largeTablet ?? size;
  if (isTablet(context)) return tablet ?? size;
  if (isPhone(context)) return phone ?? size;
  if (isTinyLimit(context)) return tiny ?? size;
  return size;
}