ScreenAdaptiveConfig class

A class that provides screen size and orientation adaptation utilities.

This class allows for adaptive layout calculations based on the screen size, orientation, and target device configuration. It should be initialized with context and orientation to adjust the layout accordingly.

Constructors

ScreenAdaptiveConfig({required MediaQueryData mediaQueryData, required ScreenInfo screenInfo, required DeviceTypeConfig deviceTypeConfig})
Constructs a ScreenAdaptiveConfig instance with the given parameters.

Properties

designMaxHeight double
The maximum design height.
no setter
designMaxWidth double
The maximum design width.
no setter
designMinHeight double
The minimum design height.
no setter
designMinWidth double
The minimum design width.
no setter
deviceTypeConfig DeviceTypeConfig
final
hashCode int
The hash code for this object.
no setterinherited
isDesktop bool
true if the device is a desktop.
no setter
isPhoneLandscape bool
true if the device is a phone in landscape orientation.
no setter
isPhonePortrait bool
true if the device is a phone in portrait orientation.
no setter
isTabletLandscape bool
true if the device is a tablet in landscape orientation.
no setter
mediaQueryData MediaQueryData
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
screenHeight double
The height of the current screen.
no setter
screenInfo ScreenInfo
final
screenWidth double
The width of the current screen.
no setter
targetDeviceType TargetDeviceType
The target device type for adaptation.
no setter

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

blockSizeHorizontal double
getter/setter pair
blockSizeVertical double
getter/setter pair
instance ScreenAdaptiveConfig?
The singleton instance of ScreenAdaptiveConfig.
no setter
safeBlockHorizontal double
getter/setter pair
safeBlockVertical double
getter/setter pair

Static Methods

checkAndResetScreenSizeChange(MediaQueryData mediaQueryData) bool
Checks if the screen size has changed since the last check.
init({required BuildContext context, required Orientation orientation, double designMinWidth = 360, double designMaxWidth = 1440, double designMinHeight = 480, double designMaxHeight = 1024, double mobilePortraitBreakpoint = 480, double mobileLandscapeBreakpoint = 768, double tabletLandscapeBreakpoint = 1024, TargetDeviceType targetDevice = TargetDeviceType.phonePortrait}) → void
Initializes the ScreenAdaptiveConfig with the given context and orientation.