of static method

SizeHelper of(
  1. BuildContext context, {
  2. bool printScreenInfo = false,
})

Implementation

static SizeHelper of(BuildContext context, {bool printScreenInfo = false}) {
  final size = MediaQuery.of(context).size;

  final width = size.width;
  final height = size.height;

  final currentOrientation =
      width > height ? Orientation.landscape : Orientation.portrait;

  final currentLength =
      currentOrientation == Orientation.portrait ? height : width;

  return SizeHelper._internal(
    currentLength,
    size,
    currentOrientation,
    printScreenInfo,
  );
}