DeclarativeSlotBuilder class

A declarative slot builder that uses a list of LayoutMatchConfigs.

It iterates through the configs and uses the first one that matches the current layout conditions. If no config matches, it uses the defaultBuilder.

Inheritance

Constructors

DeclarativeSlotBuilder({required List<LayoutMatchConfig> configs, Widget? defaultBuilder(ActiveLayoutInfo layoutInfo)?})
Creates a DeclarativeSlotBuilder.

Properties

configs List<LayoutMatchConfig>
A list of layout match configurations.
final
defaultBuilder Widget? Function(ActiveLayoutInfo layoutInfo)?
A default builder to use if no configs match. If null and no configs match, no widget is built.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(ActiveLayoutInfo layoutInfo) Widget?
Builds the widget for a slot based on the current ActiveLayoutInfo.
override
getMatchedConfig(ActiveLayoutInfo layoutInfo) LayoutMatchConfig?
Finds the best matching LayoutMatchConfig for the given layoutInfo. Returns null if no configuration matches and no default builder is specified.
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