AdaptiveBreakpoints class

Breakpoint configuration for device type detection.

Breakpoints define the screen width thresholds for determining the current device type. Supports both portrait and landscape orientations.

Constructors

AdaptiveBreakpoints({double phone = 600, double tablet = 1024, double desktop = 1440, double foldableAspectRatio = 1.1, double foldableMinWidth = 600, AdaptiveBreakpoints? landscape, bool useShortestSide = false})
Creates breakpoint configuration with custom values.
const
AdaptiveBreakpoints.withLandscape({double phone = 600, double tablet = 1024, double desktop = 1440, required double landscapePhone, required double landscapeTablet, required double landscapeDesktop})
Creates breakpoints with separate landscape configuration.
factory

Properties

desktop double
Screen width threshold for large desktop (default: 1440) Screens >= tablet and < this value are considered desktop
final
foldableAspectRatio double
Aspect ratio threshold for foldable detection (default: 1.0) Devices with aspect ratio close to 1.0 and large screens may be foldables
final
foldableMinWidth double
Minimum width to consider for foldable detection (default: 600)
final
hashCode int
The hash code for this object.
no setterinherited
landscape AdaptiveBreakpoints?
Optional breakpoints to use when device is in landscape orientation. If null, portrait breakpoints are used for both orientations.
final
phone double
Screen width threshold for tablet (default: 600) Screens < this value are considered phones
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tablet double
Screen width threshold for desktop (default: 1024) Screens >= phone and < this value are considered tablets
final
useShortestSide bool
Whether to use the shortest side for breakpoint calculations. Useful for maintaining consistent layouts across orientations.
final

Methods

getDeviceType(double width, double height) DeviceType
Determines the device type based on screen width and aspect ratio.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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

Static Methods

getOrientation(double width, double height) Orientation
Gets the current orientation.

Constants

bootstrap → const AdaptiveBreakpoints
Bootstrap-style breakpoints.
material → const AdaptiveBreakpoints
Default breakpoints matching Material Design guidelines.