DScreenUtil class
设备屏幕工具类 提供获取当前屏幕宽度、高度、像素密度、设备类型判定、安全区、高度相关常用方法等
Constructors
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
-
appBarHeight(
) → double - 获取AppBar默认高度
-
availableScreenHeight(
) → double - 获取可用屏幕高度(减去状态栏和底部安全区域)
-
bottomBarTotalHeight(
) → double - 获取底部TabBar高度+底部安全距离高度
- 获取底部导航栏高度
-
bottomSafeHeight(
) → double - 获取底部安全距离高度
-
height(
) → double - 获取屏幕高度
-
isDesktop(
) → bool - 判断是否是桌面尺寸(宽度大于等于1200dp)
-
isLandscape(
) → bool - 判断是否是横屏
-
isPhone(
) → bool - 判断是否是手机尺寸(宽度小于600dp)
-
isPortrait(
) → bool - 判断是否是竖屏
-
isTablet(
) → bool - 判断是否是平板尺寸(宽度大于等于600dp且小于1200dp)
-
orientation(
) → Orientation - 获取屏幕方向
-
pixelRatio(
) → double - 获取屏幕像素密度
-
statusBarHeight(
) → double - 获取状态栏高度
-
topSafeHeight(
) → double - 获取顶部安全距离高度(状态栏高度)
-
width(
) → double - 获取屏幕宽度