init static method

void init(
  1. double width,
  2. Orientation orientation
)

Initialize the device type and orientation based on width and orientation

Implementation

static void init(double width, Orientation orientation) {
  isTMobile = width < mobileBreakpoint;
  isTTablet = width >= mobileBreakpoint && width < tabletBreakpoint;
  isTWeb = width >= tabletBreakpoint && width < desktopBreakpoint;
  isTDesktop = width >= desktopBreakpoint;

  isTPortrait = orientation == Orientation.portrait;
  isTLandscape = orientation == Orientation.landscape;
}