getAdapterSize method
兼容横/纵屏。 获取适配后的尺寸,兼容横/纵屏切换,可用于宽,高,字体尺寸适配。 Get the appropriate size, compatible with horizontal/vertical screen switching, can be used for wide, high, font size adaptation.
Implementation
double getAdapterSize(double dp) {
if (_screenWidth == 0 || _screenHeight == 0) return dp;
return getRatio() * dp;
}