BoxAlignmentDirectional class
Text-direction-aware box alignment that adapts to locale.
BoxAlignmentDirectional provides alignment positioning that respects the text direction (LTR/RTL) of the current locale. For example, 'start' means left in LTR languages but right in RTL languages like Arabic or Hebrew.
This is the preferred alignment type when building internationalized UIs that need to adapt to different reading directions. The alignment values automatically flip for RTL contexts.
See also:
- BoxAlignment, for fixed alignment that ignores text direction
- BoxAlignmentSpacing, for spacing-based alignment
- Inheritance
-
- Object
- BoxAlignmentGeometry
- BoxAlignmentContent
- BoxAlignmentBase
- BoxAlignmentDirectional
Constructors
- BoxAlignmentDirectional(double value)
-
Creates a directional 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 and text direction.
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 of the container, respecting text direction. In LTR text, this is right/bottom; in RTL text, this is left/bottom.
- start → const BoxAlignmentBase
- Aligns to the start of the container, respecting text direction. In LTR text, this is left/top; in RTL text, this is right/top.