IPreferExplicitFlex

Interface
Indicates that widgets using implicit flex filling (e.g. ModifierFallbacks.FlexFill) should use tight constraints by default, preventing them and their children from expanding beyond their intrinsic preferred size.

Also provides the preferred flex-axis for widgets such as HGap that need to know what their main-axis is going to be.

By default, many non-layouting widgets (e.g. StatelessWidget, StatefulWidget, HThemeProvider) adopt ModifierFallbacks.FlexFill, causing them to expand along both axes.

This is convenient in isolation, but can lead to unexpected behavior in layouts like HRow, where children are typically expected to tightly size to their content unless wrapped in a FlexibleModifier. Applying a flex fill here would create unintended whitespace not occupied by the child if it is not fully flexing.

Implementing IPreferExplicitFlex changes this default by applying tight constraints to direct children when possible, preventing the widget from expanding beyond its intrinsic size unless explicitly instructed.

Properties

PreferredFlexAxis: Axis

Extension Methods

DescribeIdentityShortHashToStringNullable

On this page