UniSizeDevice class

Device information and sizing calculations

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

designHeight double
no setter
designWidth double
no setter
deviceType UniSizeDeviceType
no setter
isDesktop bool
Check if device is desktop
no setter
isLandscape bool
Check if device is in landscape mode
no setter
isMobile bool
Check if device is mobile
no setter
isPortrait bool
Check if device is in portrait mode
no setter
isTablet bool
Check if device is tablet
no setter
logicalHeight double
no setter
logicalWidth double
no setter
orientation Orientation
no setter
physicalHeight double
no setter
physicalWidth double
no setter
pixelRatio double
no setter
platformScaleFactor double
no setter
screenType UniSizeScreenType
no setter
textScaleFactor double
no setter

Static Methods

calculateDp(num value) double
Calculate density-independent pixels (dp)
calculateSp(num value) double
Calculate scalable pixels (sp) for fonts
init(BuildContext context, {required double designWidth, required double designHeight, required double minTextScaleFactor, required double maxTextScaleFactor}) → void
Initialize the device information
responsive<T>({required T mobile, T? tablet, T? desktop}) → T
Get responsive value based on screen type
update(BuildContext context) → void
Update device information (call when orientation changes)