computePosition method

  1. @override
double computePosition({
  1. required ParentLayout parent,
  2. required ChildLayout child,
  3. required LayoutAxis direction,
})
override

Returns the position of the viewport's end bound relative to content.

This calculates: contentSize + scrollOffset It represents where the viewport ends in the content coordinate space.

Implementation

@override
double computePosition({
  required ParentLayout parent,
  required ChildLayout child,
  required LayoutAxis direction,
}) {
  return switch (direction) {
    LayoutAxis.horizontal => parent.contentSize.width + parent.scrollOffsetX,
    LayoutAxis.vertical => parent.contentSize.height + parent.scrollOffsetY,
  };
}