PlatformQueryData class Null safety

Information about a piece of device (e.g., a window).

For example, the PlatformQueryData.size property contains the width and height of the current window.

To obtain the current PlatformQueryData for a given BuildContext, use the PlatformQuery.of function. For example, to obtain the size of the current window, use PlatformQuery.of(context).size.

If no PlatformQuery is in scope then the PlatformQuery.of method will throw an exception. Alternatively, PlatformQuery.maybeOf may be used, which returns null instead of throwing if no PlatformQuery is in scope.

Annotations

Constructors

PlatformQueryData({required PlatformType platformType})
Creates data for a device query with explicit values.
const
PlatformQueryData.detect()
Creates a new PlatformQueryData depending on platform. [...]
factory

Properties

hashCode int
The hash code for this object. [...]
read-only, inherited
isAndroid bool
read-only
isIos bool
read-only
isLinux bool
read-only
isMacos bool
read-only
isWeb bool
read-only
isWindows bool
read-only
platformType PlatformType
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
A string representation of this object. [...]
inherited

Operators

operator ==(Object other) bool
The equality operator. [...]
inherited