BoxAlignmentContent class abstract
Abstract base class for alignment geometries that support stretch and fixed alignments but not baseline.
This class is designed for cross-axis alignment in flex containers, particularly
for the align-content
property which controls how multiple lines of flex items
are aligned within the container. Unlike BoxAlignmentGeometry, it cannot handle
baseline alignment but supports stretch alignment and all fixed alignments.
Cross-axis alignment controls how flex items are positioned perpendicular to the main layout axis. For horizontal flex containers, this affects vertical positioning. For vertical containers, it affects horizontal positioning.
The stretch alignment allows items to expand to fill available space, while fixed alignments (start, center, end) position items at specific locations. Spacing alignments distribute space between and around items.
- Inheritance
-
- Object
- BoxAlignmentGeometry
- BoxAlignmentContent
- Implementers
Constructors
- BoxAlignmentContent.new()
-
const
- BoxAlignmentContent.absolute(double value)
-
Creates an absolute alignment with a custom value.
constfactory
- BoxAlignmentContent.directional(double value)
-
Creates a directional alignment with a custom value.
constfactory
- BoxAlignmentContent.spaceAroundRatio(double startRatio, double endRatio)
-
Creates custom spacing ratios for start and end.
constfactory
- BoxAlignmentContent.spaceAroundSymmetric(double ratio)
-
Creates symmetric spacing around items with a custom ratio.
constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
adjustSize(
{required ParentLayout parent, required LayoutAxis axis, required double viewportSize, required double contentSize}) → double? -
Optionally adjusts the size of the child during alignment.
inherited
-
adjustSpacing(
{required ParentLayout parent, required LayoutAxis axis, required double viewportSize, required double contentSize, required double startSpacing, required double spacing, required double endSpacing, required int affectedCount}) → ({double additionalEndSpacing, double additionalSpacing, double additionalStartSpacing})? - Adjusts spacing between items when distributing space.
-
align(
{required ParentLayout parent, required LayoutAxis axis, required double viewportSize, required double contentSize, required double maxBaseline, required double childBaseline}) → double -
Calculates the alignment position for a child within its parent container.
inherited
-
needsBaseline(
{required ParentLayout parent, required LayoutAxis axis}) → bool -
Determines if this alignment requires baseline information.
inherited
-
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
Constants
- center → const BoxAlignmentContent
- Centers items along the cross-axis.
- end → const BoxAlignmentContent
- Aligns items to the end of the cross-axis.
- spaceAround → const BoxAlignmentContent
- Distributes items with equal space around each item.
- spaceBetween → const BoxAlignmentContent
- Distributes items with equal space between them, no space at the edges.
- spaceEvenly → const BoxAlignmentContent
- Distributes items with equal space between and around them.
- start → const BoxAlignmentContent
- Aligns items to the start of the cross-axis.
- stretch → const BoxAlignmentContent
- Stretches items to fill the available cross-axis space.