LayoutMatchConfig constructor

LayoutMatchConfig({
  1. Set<AdaptivePlatform>? platforms,
  2. bool breakpointMatcher(
    1. BreakpointId activeId
    )?,
  3. Orientation? orientationMatcher,
  4. bool formFactorMatcher(
    1. DeviceFormFactor formFactor
    )?,
  5. required Widget? builder(
    1. ActiveLayoutInfo layoutInfo
    ),
  6. bool isPersistent = false,
})

Creates a LayoutMatchConfig.

At least one condition (platforms, breakpointMatcher, or orientationMatcher) should typically be provided, along with the builder.

Implementation

LayoutMatchConfig({
  this.platforms,
  this.breakpointMatcher,
  this.orientationMatcher,
  this.formFactorMatcher, // Added to constructor
  required this.builder,
  this.isPersistent = false, // Default to false
}) : _specificity = (platforms?.isNotEmpty == true ? 1 : 0) +
          (breakpointMatcher != null ? 1 : 0) +
          (orientationMatcher != null ? 1 : 0) +
          (formFactorMatcher != null
              ? 1
              : 0);