currentDevice method

DeviceType currentDevice(
  1. double width
)

Implementation

DeviceType currentDevice(double width){
  if (width >= DeviceType.desktop.breakpoint) {
    return DeviceType.desktop;
  }
  // If width it less then desktopRes and more then tabletRes we consider it as tablet
  else if (width >= DeviceType.tablet.breakpoint) {
    return DeviceType.tablet;
  }
  // Or less then that we called it mobile
  else {
    return DeviceType.mobile;
  }
}