ah property
double
get
ah
Calculates adaptive height based on the screen height and design height values.
This method interpolates between a small screen value and a large screen value based on the current screen height. It returns a height that scales proportionally between the minimum and maximum design heights.
Implementation
double get ah {
double smallScreenValue = item1.toDouble();
double largeScreenValue = item2.toDouble();
double minHeight = ScreenAdaptiveConfig.instance!.designMinHeight;
double maxHeight = ScreenAdaptiveConfig.instance!.designMaxHeight;
if (ScreenAdaptiveConfig.instance!.screenHeight < minHeight) {
return smallScreenValue;
} else if (ScreenAdaptiveConfig.instance!.screenHeight > maxHeight) {
return largeScreenValue;
} else {
return smallScreenValue +
(largeScreenValue - smallScreenValue) *
(ScreenAdaptiveConfig.instance!.screenHeight - minHeight) /
(maxHeight - minHeight);
}
}