customWidthHeight method

dynamic customWidthHeight(
  1. double screenWidth,
  2. double screenHeight,
  3. dynamic onWidthHeight(
    1. double width,
    2. double height
    )
)

Implementation

customWidthHeight(
  double screenWidth,
  double screenHeight,
  Function(double width, double height) onWidthHeight,
) {
  double tempWidth = ((screenWidth - 80) / 1.5).toDouble();
  if (tempWidth > 225) {
    tempWidth = 225;
  }
  if (tempWidth < 175) {
    tempWidth = 175;
  }
  double tempHeight = ((screenHeight - 100) / 5).toDouble();
  if (tempHeight > 70) {
    tempHeight = 75;
  }
  if (tempHeight < 40) {
    tempHeight = 40;
  }
  onWidthHeight(tempWidth, tempHeight);
}