BoxAlignmentBase class abstract
Abstract base class for alignment geometries that don't support baseline or stretch.
This class is specifically designed for main-axis alignment in flex containers. Unlike BoxAlignmentGeometry, it cannot handle baseline alignment (which requires text baseline information) or stretch alignment (which modifies child sizes).
Main-axis alignment controls how flex items are distributed along the primary layout axis (horizontal for rows, vertical for columns). It includes fixed alignments (start, center, end) and spacing alignments (space-between, space-evenly, etc.).
Use this class when you need to align items along the main axis without baseline considerations or size stretching.
- Inheritance
-
- Object
- BoxAlignmentGeometry
- BoxAlignmentContent
- BoxAlignmentBase
- Implementers
Constructors
- BoxAlignmentBase.new()
-
const
- BoxAlignmentBase.absolute(double value)
-
Creates an absolute alignment with a custom value.
constfactory
- BoxAlignmentBase.directional(double value)
-
Creates a directional alignment with a custom value.
constfactory
- BoxAlignmentBase.spaceAroundRatio(double startRatio, double endRatio)
-
Creates custom spacing ratios for start and end.
constfactory
- BoxAlignmentBase.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.
inherited
-
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 -
This alignment never requires baseline information since it doesn't support baseline alignment.
override
-
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 BoxAlignmentBase
- Centers items along the main axis.
- end → const BoxAlignmentBase
- Aligns items to the end of the main axis.
- spaceAround → const BoxAlignmentBase
- Distributes items with equal space around each item.
- spaceBetween → const BoxAlignmentBase
- Distributes items with equal space between them, no space at the edges.
- spaceEvenly → const BoxAlignmentBase
- Distributes items with equal space between and around them.
- start → const BoxAlignmentBase
- Aligns items to the start of the main axis.