getDeviceCategory static method
Implementation
static AtomicDeviceCategory getDeviceCategory(BuildContext context) {
final size = MediaQuery.of(context).size;
final shortestSide = size.shortestSide;
if (shortestSide < 600) {
return AtomicDeviceCategory.mobile;
} else if (shortestSide < 905) {
return AtomicDeviceCategory.tablet;
} else {
return AtomicDeviceCategory.desktop;
}
}