getType static method
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;
}