OrkittScreenUtils class

A utility class providing global access to the current device's layout properties such as screen dimensions, orientation, and pixel density. Utility for resolving screen size, safe area, OS type, and screen type.

Call initialize before using any other property.

Constructors

OrkittScreenUtils()

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 Properties

aspectRatio double
Aspect ratio (width / height).
no setter
height double
Screen height in logical pixels.
no setter
orientation Orientation
Device orientation.
no setter
osType OSType
Operating system type.
no setter
pixelRatio double
Physical pixel density.
no setter
safeHeight double
Safe height excluding vertical padding.
no setter
safeWidth double
Safe width excluding horizontal padding.
no setter
screenType ScreenType
Screen type: mobile, tablet, or desktop.
no setter
width double
Screen width in logical pixels.
no setter

Static Methods

initialize({required MediaQueryData mediaQuery, BuildContext? context}) → void
Initializes device metrics and screen classification.
percentFontSize(double size) double
Returns scaled font size based on screen size and density.
percentHeight(double percent) double
Returns height scaled by percentage (0-100).
percentRadius(double percent) double
Returns radius scaled by percentage of safe width.
percentWidth(double percent) double
Returns width scaled by percentage (0-100).