FlexboxContainerComponent

Sealed base class for flexbox container components (Column/Row) that extends Component directly instead of the legacy SpecGeneratedComponent.

Supports both uniform gaps (via gap) and direction-specific gaps (via mainAxisGap and crossAxisGap).

Gap Parameters:

  • gap: Uniform gap applied to both main and cross axes (maps to YogaGutter.ALL). Backward compatible.

  • mainAxisGap: Gap along the main axis (direction of flexDirection). For Row: horizontal spacing. For Column: vertical spacing. Maps to YogaGutter.COLUMN for Row, YogaGutter.ROW for Column.

  • crossAxisGap: Gap along the cross axis (perpendicular to flexDirection). For Row: vertical spacing. For Column: horizontal spacing. Maps to YogaGutter.ROW for Row, YogaGutter.COLUMN for Column.

When to use each:

  • Use gap when you need uniform spacing in all directions (most common case).

  • Use mainAxisGap and crossAxisGap when you need different spacing along each axis, typically when wrap=WRAP to control spacing between wrapped rows/columns separately from spacing within a row/column.

If both gap and direction-specific gaps are provided, direction-specific gaps take precedence.

Gap values are held as Dimen and resolved to pixels at layout time, so the construction site does not need a ComponentContext or com.facebook.litho.ResourcesScope to build a container.

Inheritors

Functions

Link copied to clipboard
Link copied to clipboard
operator override fun equals(@Nullable other: Any?): Boolean
Link copied to clipboard
Link copied to clipboard
open fun <T : Any> getDebugAttribute(attributeKey: AttributeKey<T>): @Nullable T?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

This indicates the type of the Object that will be returned by mount.

Link copied to clipboard
open override fun getSimpleName(): String
Link copied to clipboard
fun getTypeId(): Int
Link copied to clipboard
override fun hashCode(): Int
Link copied to clipboard
open override fun isEquivalentTo(@Nullable other: Component?): Boolean

Compares this component to a different one to check if they are the same

Link copied to clipboard
Link copied to clipboard
fun measure(c: ComponentContext, widthSpec: Int, heightSpec: Int, outputSize: Size)
fun measure(c: ComponentContext, widthSpec: Int, heightSpec: Int, outputSize: Size, shouldCacheResult: Boolean)

Measure a component with the given SizeSpec constraint.

Link copied to clipboard
fun measureMightNotCacheInternalNode(c: ComponentContext, widthSpec: Int, heightSpec: Int, outputSize: Size)

Should not be used! Components should be manually measured only as part of a LayoutState calculation. This will measure a component and set the size in the outputSize object but the measurement result will not be cached and reused for future measurements of this component.

Link copied to clipboard
open override fun resolveDeferred(calculationContext: CalculationContext, componentContext: ComponentContext, parentContext: ComponentContext): ComponentResolveResult

Returns the component's resolve result for a deferred resolution. The framework invokes this instead of the resolve if the component needs to defer its resolution until layout.

Link copied to clipboard
fun Component.resolveDeferred(calculationContext: CalculationContext, componentContext: ComponentContext, parentContext: ComponentContext, commonProps: CommonProps?): ComponentResolveResult
Link copied to clipboard
Link copied to clipboard
open override fun <T : Any> setDebugAttributeKey(attributeKey: AttributeKey<T>, value: T & Any)
Link copied to clipboard
override fun toString(): String