screenSize static method

ScreenSize screenSize(
  1. BuildContext context
)

Returns the size of the screen according to the type of device, as specified in ScreenSize

Implementation

static ScreenSize screenSize(BuildContext context) {
  if ((orientation(context) == Orientation.portrait && w(context) > 1200) ||
      (orientation(context) == Orientation.landscape && h(context) > 1200)) {
    return ScreenSize.desktop;
  } else if ((orientation(context) == Orientation.portrait &&
          w(context) > 600) ||
      (orientation(context) == Orientation.landscape && h(context) > 600)) {
    return ScreenSize.tablet;
  } else {
    return ScreenSize.mobile;
  }
}