ResponsiveValue<T>.upto constructor
ResponsiveValue<T>.upto ({
- bool allowNull = false,
- T? xlarge,
- T? large,
- T? medium,
- T? small,
- T? fallback,
Implementation
factory ResponsiveValue.upto({
bool allowNull = false,
T? xlarge,
T? large,
T? medium,
T? small,
// T? xsmall,
T? fallback,
}) {
T? xlargeValue;
T? largeValue;
T? mediumValue;
T? smallValue;
T? xsmallValue;
if (xlarge != null) {
xsmallValue = xlarge;
smallValue = xlarge;
mediumValue = xlarge;
largeValue = xlarge;
xlargeValue = xlarge;
}
if (large != null) {
xsmallValue = large;
smallValue = large;
mediumValue = large;
largeValue = large;
}
if (medium != null) {
xsmallValue = medium;
smallValue = medium;
mediumValue = medium;
}
if (small != null) {
xsmallValue = small;
smallValue = small;
}
return ResponsiveValue(
allowNull: allowNull,
xsmall: xsmallValue,
small: smallValue,
medium: mediumValue,
large: largeValue,
xlarge: xlargeValue,
fallback: fallback,
);
}