responsiveByWidth<T> function

T responsiveByWidth<T>(
  1. dynamic context,
  2. T size, {
  3. T? computer,
  4. T? tablet2,
  5. T? tablet1,
  6. T? phone,
})

Implementation

T responsiveByWidth<T>(context, T size,
    {T? computer, T? tablet2, T? tablet1, T? phone}) {
  if (context == null) return size;
  if (ResponLayout.isComputer(context)) {
    return computer ?? size;
  }
  if (ResponLayout.isTablet2(context)) {
    return tablet2 ?? size;
  }
  if (ResponLayout.isTablet1(context)) {
    return tablet1 ?? size;
  }
  if (ResponLayout.isPhone(context)) {
    return phone ?? size;
  }
  return size;
}