aspectRatio property

double get aspectRatio

Implementation

double get aspectRatio {
  if (!hasVideo) return 16 / 9;
  final bool swapped = rotationDegrees == 90 || rotationDegrees == 270;
  final double w = (swapped ? height : width).toDouble();
  final double h = (swapped ? width : height).toDouble();
  return h == 0 ? 16 / 9 : w / h;
}