BoxAlignment class
Fixed-position box alignment that doesn't consider text direction.
BoxAlignment provides absolute alignment positioning where values are interpreted consistently regardless of text direction (LTR/RTL). For example, -1.0 always means left (horizontal) or top (vertical), while 1.0 always means right or bottom.
Use this when you need consistent alignment that doesn't change based on locale. For text-direction-aware alignment, use BoxAlignmentDirectional.
See also:
- BoxAlignmentDirectional, for text-direction-aware alignment
- BoxAlignmentSpacing, for spacing-based alignment
- Inheritance
-
- Object
- BoxAlignmentGeometry
- BoxAlignmentContent
- BoxAlignmentBase
- BoxAlignment
Constructors
- BoxAlignment(double value)
-
Creates an absolute alignment with the specified value.
const
Properties
Methods
-
adjustSize(
{required ParentLayout parent, required LayoutAxis axis, required double viewportSize, required double contentSize, required double childSize}) → 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 based on the value.
override
-
needsBaseline(
{required ParentLayout parent, required LayoutAxis axis}) → bool -
This alignment never requires baseline information since it doesn't support baseline alignment.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- baseline → const BoxAlignmentGeometry
- Aligns items based on their text baseline.
- center → const BoxAlignmentBase
- Centers content within the container.
- end → const BoxAlignmentBase
- Aligns to the end (right/bottom) of the container.
- start → const BoxAlignmentBase
- Aligns to the start (left/top) of the container.