screenConfiguration method

void screenConfiguration(
  1. BuildContext context
)

Implementation

void screenConfiguration(BuildContext context) {
  double width = MediaQuery.of(context).size.width;
  double height = MediaQuery.of(context).size.height;
  //double width = window.physicalSize.width;
  //double height = window.physicalSize.height;
  final platform = Theme.of(context).platform;
  if (platform == TargetPlatform.android ||
      platform == TargetPlatform.iOS ||
      platform == TargetPlatform.fuchsia) {
    _deviceType = DeviceType.mobile;
  } else {
    _deviceType = DeviceType.desktop;
  }
  if (_deviceType == DeviceType.mobile && width > height) {
    _screenMode = ScreenMode.landScape;
  } else if (_deviceType == DeviceType.mobile && height > width) {
    _screenMode = ScreenMode.mobile;
  } else if (_deviceType == DeviceType.desktop &&
      width <= Get.find<PageManager>().currentPageLimits.mobile) {
    _screenMode = ScreenMode.mobile;
  } else if (_deviceType == DeviceType.desktop &&
      width <= Get.find<PageManager>().currentPageLimits.landScape &&
      width > Get.find<PageManager>().currentPageLimits.mobile) {
    _screenMode = ScreenMode.landScape;
  } else if (_deviceType == DeviceType.desktop &&
      width <= Get.find<PageManager>().currentPageLimits.desktopMini &&
      width > Get.find<PageManager>().currentPageLimits.landScape) {
    _screenMode = ScreenMode.desktopMini;
  } else {
    _screenMode = ScreenMode.desktopLarge;
  }
}