isDesktop static method

bool isDesktop(
  1. BuildContext context
)

Check if the device is a desktop. This method checks the width of the screen in the given BuildContext context and returns true if the width is greater than 1024, indicating a desktop.

Implementation

static bool isDesktop(BuildContext context) {
  return MediaQuery.sizeOf(context).width > 1024;
}