Repository navigation
Description
Description
In TableView, when trailingPinnedColumnCount or trailingPinnedRowCount is greater than 0, the spans designated as trailing pinned are being incorrectly included in the range of "regular" (non-pinned) spans. This results in these cells being built and laid out twice during every layout pass.
Steps to Reproduce
- Create a
TableViewwith a large number of rows/columns. - Set
trailingPinnedColumnCount: 1. - Observe (e.g., via logs in
cellBuilder) that cells in the last column are built twice.
Expected Results
Each TableVicinity should be built and laid out exactly once per layout pass. Trailing pinned spans should be excluded from the "non-pinned" range.
Actual Results
Trailing pinned spans are included in the non-pinned range because the range is capped by the total metrics length rather than the index of the first trailing pinned span.
Root Cause
In RenderTableViewport._updateFirstAndLastVisibleCell (lib/src/table_view/table.dart), the _lastNonPinnedColumn and _lastNonPinnedRow indices are defaulted to the end of the metrics maps (metrics.length - 1) instead of being capped by _lastRegularColumnIndex and _lastRegularRowIndex.
Proposed Fix
Update the capping logic to use the pre-calculated regular span indices (_lastRegularColumnIndex / _lastRegularRowIndex).
Activity
[two_dimensional_scrollables] Exclude trailing pinned spans from the …
github-actions commentedon Oct 9, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.