widthForHeight static method

double widthForHeight(
  1. double height,
  2. double aspectRatio
)

Width that keeps the given aspectRatio for height.

Implementation

static double widthForHeight(double height, double aspectRatio) {
  if (aspectRatio <= 0) return height;
  return height * aspectRatio;
}