deviceType static method

DeviceType deviceType(
  1. BuildContext context
)

Returns isDesktop for the nearest DeviceQuery ancestor or DeviceType.unknown, if no such ancestor exists.

Implementation

static DeviceType deviceType(BuildContext context) {
  return DeviceQuery.maybeOf(context)?.deviceType ?? DeviceType.unknown;
}