FlexLayoutHandle class

Handle for performing flex layout operations.

FlexLayoutHandle implements the complete CSS Flexbox layout algorithm. It manages the complex multi-pass layout process including:

  1. Line Breaking: Distributing children into flex lines
  2. Main Axis Sizing: Calculating sizes along the main axis with flex grow/shrink
  3. Cross Axis Sizing: Calculating sizes along the cross axis Handle for performing flexbox layout calculations.

FlexLayoutHandle implements the flexbox layout algorithm as specified in the CSS Flexbox specification. It manages the complex multi-pass layout process including:

  1. Line Breaking: Determining which children belong to which flex lines
  2. Main Sizing: Calculating sizes along the main axis
  3. Flexing: Applying flex-grow and flex-shrink factors
  4. Cross Sizing: Calculating sizes along the cross axis
  5. Alignment: Positioning items within lines and lines within the container
  6. Spacing: Applying gaps between items and padding

The algorithm follows the CSS Flexbox specification closely, with optimizations for Flutter's layout system and support for RTL text directions.

Inheritance

Constructors

FlexLayoutHandle.new(FlexLayout layout, ParentLayout parent)
Creates a flex layout handle for the given layout and parent.

Properties

cache FlexLayoutCache
no setter
hashCode int
The hash code for this object.
no setterinherited
layout FlexLayout
The layout algorithm this handle implements.
finalinherited
parent ParentLayout
The parent container this handle is laying out.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

computeMaxIntrinsicHeight(double width) double
Computes the maximum intrinsic height at the given width.
inherited
computeMaxIntrinsicWidth(double height) double
Computes the maximum intrinsic width at the given height.
inherited
computeMinIntrinsicHeight(double width) double
Computes the minimum intrinsic height at the given width.
inherited
computeMinIntrinsicWidth(double height) double
Computes the minimum intrinsic width at the given height.
inherited
debugPrintLines() → void
indexOfNearestChildAtOffset(LayoutOffset offset) int
Finds the index of the child at the given offset. Returns -1 if no child is found at the offset.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performLayout(LayoutConstraints constraints, [bool dry = false]) LayoutSize
Performs the complete flex layout algorithm.
override
performPositioning(LayoutSize viewportSize, LayoutSize contentSize) LayoutRect
Calculates the positioning rectangle for content within the viewport.
override
setupCache() ChildLayoutCache
Creates a new cache instance for flex child layout operations.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited