platformType static method
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;
}