performBoxLayout method

  1. @override
void performBoxLayout(
  1. BoxConstraints constraints
)
override

Perform layout with typed box constraints

Subclasses override this instead of performLayout. The default implementation sizes to the maxima, treating an unbounded axis as the corresponding lower bound.

Implementation

@override
void performBoxLayout(BoxConstraints constraints) {
  // Fall back to minWidth when both the explicit width and the parent's
  // maxWidth are unspecified so we still produce a definite size.
  final w = _explicitWidth ?? constraints.maxWidth ?? constraints.minWidth;
  size = Size(
    constraints.constrainWidth(w),
    constraints.constrainHeight(_heightLines),
  );
}