AdaptiveDeviceInfo class

Contains all adaptive device and screen information.

This class provides easy access to screen metrics, device type, and scaling ratios for responsive design.

Constructors

AdaptiveDeviceInfo({required double screenWidth, required double screenHeight, required Orientation orientation, required double pixelRatio, required DeviceType deviceType, required ScreenSize screenSize, required Size designSize, required double statusBarHeight, required double bottomBarHeight, required double textScaleFactor, required EdgeInsets safeAreaPadding})
Creates device info from screen metrics.
const
AdaptiveDeviceInfo.of(BuildContext context, {required AdaptiveBreakpoints breakpoints, required DesignSize designSizeConfig, required ScreenSizeBreakpoints screenSizeBreakpoints})
Creates device info from a BuildContext.
factory

Properties

bottomBarHeight double
The bottom bar height (bottom safe area).
final
designSize Size
The design size used for scaling calculations.
final
deviceType DeviceType
The detected device type.
final
hashCode int
The hash code for this object.
no setterinherited
isDesktop bool
Returns true if this is a desktop.
no setter
isFoldable bool
Returns true if this is a foldable device.
no setter
isLandscape bool
Returns true if the device is in landscape orientation.
no setter
isPhone bool
Returns true if this is a phone.
no setter
isPortrait bool
Returns true if the device is in portrait orientation.
no setter
isTablet bool
Returns true if this is a tablet.
no setter
orientation Orientation
The current device orientation.
final
pixelRatio double
The device pixel ratio (for hi-dpi screens).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
safeAreaPadding EdgeInsets
The safe area padding.
final
scaleHeight double
The height scale ratio (actual height / design height).
no setter
scaleRadius double
The minimum of width and height scale (for radius/uniform scaling).
no setter
scaleWidth double
The width scale ratio (actual width / design width).
no setter
screenHeight double
The current screen height in logical pixels.
final
screenSize ScreenSize
The detected screen size category.
final
screenWidth double
The current screen width in logical pixels.
final
statusBarHeight double
The status bar height (top safe area).
final
textScaleFactor double
The text scale factor from system settings.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setHeight(num height) double
Scales a height value based on the design size.
setRadius(num radius) double
Scales a value uniformly (uses the smaller of width/height ratio).
setSp(num fontSize) double
Scales a font size with text scale factor consideration.
setWidth(num width) double
Scales a width value based on the design size.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited