calculateFor method
Implementation
double calculateFor(double currentScreenSize) {
double? result;
result = _forEachTwoClosestBreakpoints((first, last) {
if (currentScreenSize.isBetween(first, last)) {
return _linearInterpolationOf(first, last,
screensize: currentScreenSize);
}
});
if (result == null) {
if (currentScreenSize < breakpoints.first.size) {
return breakpoints.first.percentage;
} else {
return breakpoints.last.percentage;
}
} else {
return result;
}
}