DeviceUtil class

设备工具类

提供获取当前设备信息、判断设备类型、方向等方法。

Constructors

DeviceUtil()

Properties

hashCode int
The hash code for this object.
no setterinherited
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

Static Methods

info() Future<DeviceInfo?>
获取当前设备的详细信息
isDesktop() bool
判断当前运行环境是否为桌面系统(Windows/MacOS/Linux)
isLandscape() bool
判断屏幕方向是否为横屏
isPhone() bool
判断当前设备是否为手机
isPortrait() bool
判断屏幕方向是否为竖屏
isTablet() bool
判断当前设备是否为平板
isWeb() bool
判断当前运行环境是否为Web