calculateAspectRatio static method

double calculateAspectRatio(
  1. BuildContext context
)

Implementation

static double calculateAspectRatio(BuildContext context) {
  final size = MediaQuery.of(context).size;
  final width = size.width;
  final height = size.height;

  return width > height ? width / height : height / width;
}