LayoutMatchConfig class

Configuration for matching layout conditions.

This class defines the criteria (platform, breakpoint, orientation) under which a specific layout or widget variant should be used.

Constructors

LayoutMatchConfig({Set<AdaptivePlatform>? platforms, bool breakpointMatcher(BreakpointId activeId)?, Orientation? orientationMatcher, bool formFactorMatcher(DeviceFormFactor formFactor)?, required Widget? builder(ActiveLayoutInfo layoutInfo), bool isPersistent = false})
Creates a LayoutMatchConfig.

Properties

breakpointMatcher bool Function(BreakpointId activeId)?
A function to match breakpoints (e.g., (id) => id.isSmall()). If null, the config matches any breakpoint.
final
builder Widget? Function(ActiveLayoutInfo layoutInfo)
The builder function that constructs the widget when this config matches.
final
formFactorMatcher bool Function(DeviceFormFactor formFactor)?
A function to match device form factors (e.g., (factor) => factor == DeviceFormFactor.tablet). If null, the config matches any form factor.
final
hashCode int
The hash code for this object.
no setterinherited
isPersistent bool
Indicates if this configuration, when matched for a drawer/pane slot, should result in a persistent (inline) display rather than a modal/overlay one. Defaults to false.
final
orientationMatcher Orientation?
The target orientation (e.g., Orientation.portrait). If null, the config matches any orientation.
final
platforms Set<AdaptivePlatform>?
A set of target platforms (e.g., {AdaptivePlatform.ANDROID, AdaptivePlatform.WEB}). If null, the config matches any platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
specificity int
Returns the specificity of this configuration. Used to resolve conflicts if multiple configurations match.
no setter

Methods

matches({required BreakpointId activeBreakpointId, required Orientation currentOrientation, required AdaptivePlatform currentPlatform, required DeviceFormFactor currentFormFactor}) bool
Checks if this configuration matches the given layout parameters.
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