FlexboxScope

Receiver for the trailing lambda on Row and Column. Exposes child to add children to the container being built.

This scope does not implement ResourcesScope. The container construction does not need a com.facebook.litho.ComponentContext — gap Dimen values are resolved to pixels at layout time. Resource lookups (colorRes, drawableRes, stringRes) called inside the children block resolve against the enclosing ResourcesScope (e.g., ComponentScope inside KComponent.render).

Annotated with FlexboxContainerDsl — a marker distinct from com.facebook.litho.ContainerDsl so that, inside nested Row { Row { … } } chains, child resolves against the innermost FlexboxScope only, while outer ResourcesScope extensions (carried by ComponentScope, LazyListScope, etc., which use a different — or no — marker) remain reachable from the children block.

Functions

Link copied to clipboard
fun child(component: Component?)

Adds a Component as a child of the Row or Column being built.