isTablet function

bool isTablet()

Implementation

bool isTablet() {
  // ignore: deprecated_member_use
  final size = window.physicalSize / window.devicePixelRatio;
  final orientation =
      (size.width > size.height) ? Orientation.landscape : Orientation.portrait;

  // Adjust these thresholds based on your specific requirements
  const tabletWidthThreshold = 600.0;
  const tabletHeightThreshold = 800.0;

  return (orientation == Orientation.landscape &&
          size.width >= tabletWidthThreshold) ||
      (orientation == Orientation.portrait &&
          size.height >= tabletHeightThreshold);
}