getSizeScale method
Size
getSizeScale(
- dynamic degrees,
- dynamic width,
- dynamic height,
- dynamic screenWidth,
- dynamic screenHeight,
Implementation
Size getSizeScale(degrees, width, height, screenWidth, screenHeight){
double targetWidth = screenWidth;
double targetHeight = screenHeight;
double scaleWidth = targetWidth / width;
double scaleHeight = targetHeight / height;
double scale = scaleWidth < scaleHeight ? scaleWidth : scaleHeight;
sizeScale = scale;
double resizedWidth = width * scale;
double resizedHeight = height * scale;
if(resizedHeight > 0.8 * getScreenHeight() - appBarHeight){
resizedHeight = 0.8 * getScreenHeight() - appBarHeight;
}
if(resizedWidth < getScreenWidth()){
resizedWidth = getScreenWidth();
}
return Size(resizedWidth, resizedHeight);
}