stackLoose method

Stack stackLoose({
  1. AlignmentGeometry alignment = AlignmentDirectional.topStart,
  2. TextDirection? textDirection,
  3. Clip clipBehavior = Clip.hardEdge,
})

Creates a Stack with StackFit.loose sizing behavior.

In loose mode, the stack will be as large as its largest child. Non-positioned children will be given loose constraints, allowing them to size themselves naturally. This is the default behavior.

Parameters:

  • alignment: How to align the children in the stack. Defaults to AlignmentDirectional.topStart.
  • textDirection: The text direction to use when resolving alignment.
  • clipBehavior: The content clipping behavior. Defaults to Clip.hardEdge.

Returns a Stack widget with loose sizing behavior.

Implementation

Stack stackLoose({
  AlignmentGeometry alignment = AlignmentDirectional.topStart,
  TextDirection? textDirection,
  Clip clipBehavior = Clip.hardEdge,
}) =>
    stack(
      fit: StackFit.loose,
      alignment: alignment,
      textDirection: textDirection,
      clipBehavior: clipBehavior,
    );