axisFor static method

Axis axisFor(
  1. BuildContext context,
  2. double horizontalAspectRatio
)

Implementation

static Axis axisFor(BuildContext context, double horizontalAspectRatio) {
  final screenSize = MediaQuery.of(context).size;
  final aspectRatio = screenSize.width / screenSize.height;
  if (aspectRatio >= horizontalAspectRatio) return Axis.horizontal;
  return Axis.vertical;
}