affectsRow method

bool affectsRow(
  1. double rowId
)

Whether this change could affect any cell of rowId.

This is the candidate filter, not the rebuild decision. A DataGridColumn.valueAccessor is handed the whole row, so a cellValueSetter that touches anything beyond the column it was invoked for changes other columns too — the example's Quantity setter calls row.updateTotal(), and the Total column reads row.total. Filtering on affectsCell alone left every such derived cell stale until something unrelated happened to rebuild it.

Widening the filter to the row is not on its own the fix: that would rebuild all 60 cells of a 60-column row for a one-field edit. So the row is only where the search starts — each candidate cell then re-runs its own valueAccessor and rebuilds only if the value it renders actually changed. See _DataGridCellState._shouldRefreshValue.

Implementation

bool affectsRow(double rowId) => this.rowId == rowId;