platformType static method

PlatformType platformType(
  1. BuildContext context
)

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

Implementation

static PlatformType platformType(BuildContext context) {
  return PlatformQuery.maybeOf(context)?.platformType ?? PlatformType.unknown;
}