heightForWidth static method

double heightForWidth(
  1. double width,
  2. double aspectRatio
)

Height that keeps the given aspectRatio for width.

Implementation

static double heightForWidth(double width, double aspectRatio) {
  if (aspectRatio <= 0) return width;
  return width / aspectRatio;
}