isScreen static method

bool isScreen(
  1. BuildContext context, {
  2. bool mobileSmall = false,
  3. bool mobileMedium = false,
  4. bool mobileLarge = false,
  5. bool tablet = false,
  6. bool laptop = false,
  7. bool laptopLarge = false,
  8. bool fourK = false,
})

Screen equals or greater than.

Implementation

static bool isScreen(BuildContext context,
    {bool mobileSmall = false,
    bool mobileMedium = false,
    bool mobileLarge = false,
    bool tablet = false,
    bool laptop = false,
    bool laptopLarge = false,
    bool fourK = false}) {
  double width = MediaQuery.of(context).size.width;
  if (mobileSmall && width >= _dimension!.mobileSmall) {
    return true;
  }
  if (mobileMedium && width >= _dimension!.mobileMedium) {
    return true;
  }
  if (mobileLarge && width >= _dimension!.mobileLarge) {
    return true;
  }
  if (tablet && width >= _dimension!.tablet) {
    return true;
  }
  if (laptop && width >= _dimension!.laptop) {
    return true;
  }
  if (laptopLarge && width >= _dimension!.laptopLarge) {
    return true;
  }
  if (fourK && width >= _dimension!.fourK) {
    return true;
  }

  return false;
}