wScreenIs function

bool wScreenIs(
  1. BuildContext context,
  2. String name
)

Checks if the current screen width is at least the given breakpoint.

Example:

if (wScreenIs(context, 'md')) {
  // Screen is tablet or larger
}

Implementation

bool wScreenIs(BuildContext context, String name) {
  final screenWidth = MediaQuery.of(context).size.width;
  final breakpointValue = wScreen(context, name);

  if (breakpointValue == null) return false;

  return screenWidth >= breakpointValue;
}