deviceType method

DeviceType deviceType(
  1. double cx,
  2. double cy
)

Determines the type of the device based on the given coordinates.

Implementation

DeviceType deviceType(double cx, double cy) {
  if (isMobile(cx, cy)) {
    return DeviceType.mobile;
  } else if (isTab(cx, cy)) {
    return DeviceType.tab;
  } else if (isLaptop(cx, cy)) {
    return DeviceType.laptop;
  } else if (isDesktop(cx, cy)) {
    return DeviceType.desktop;
  } else {
    return DeviceType.other;
  }
}