responsiveByWidth<T> function
T
responsiveByWidth<T>(
- dynamic context,
- T size, {
- T? computer,
- T? tablet2,
- T? tablet1,
- 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;
}