PlatformQueryData class
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.
no setterinherited
- isAndroid → bool
-
no setter
- isIos → bool
-
no setter
- isLinux → bool
-
no setter
- isMacos → bool
-
no setter
- isWeb → bool
-
no setter
- isWindows → bool
-
no setter
- platformType → PlatformType
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited