getType static method

DeviceScreenType getType([
  1. Size? size
])

Implementation

static DeviceScreenType getType([Size? size]) {
  // Use .shortestSide to detect device type regardless of orientation
  final shortestSide = (size ?? windowSize).shortestSide;
  if (shortestSide > ScreenFormFactor.TV) return DeviceScreenType.TV;
  if (shortestSide > ScreenFormFactor.DESKTOP) {
    return DeviceScreenType.DESKTOP;
  }
  if (shortestSide > ScreenFormFactor.TABLET) return DeviceScreenType.TABLET;
  if (shortestSide > ScreenFormFactor.MOBILE) return DeviceScreenType.MOBILE;
  return DeviceScreenType.WATCH;
}