computePosition method
double
computePosition({
- required ParentLayout parent,
- required ChildLayout child,
- required LayoutAxis direction,
override
Computes the position and clamps it between min and max bounds.
First computes the base position, then computes the min and max bounds, and finally clamps the result to ensure it stays within the allowed range.
Implementation
@override
double computePosition({
required ParentLayout parent,
required ChildLayout child,
required LayoutAxis direction,
}) {
double pos = position.computePosition(
parent: parent,
child: child,
direction: direction,
);
double minPos = min.computePosition(
parent: parent,
child: child,
direction: direction,
);
double maxPos = max.computePosition(
parent: parent,
child: child,
direction: direction,
);
return pos.clamp(minPos, maxPos);
}