aspectRatio property Null safety

double aspectRatio

Implementation

double get aspectRatio {
  if (width == 0 || height == 0) {
    return 1;
  }
  return isPortrait ? height / width : width / height;
}