modifyRowValue method

void modifyRowValue(
  1. TResultId itemId,
  2. void update(
    1. TResult item
    )
)

Updates an item from the current resultset with the id itemId and rebuilds the row.

Implementation

void modifyRowValue(TResultId itemId, void Function(TResult item) update) {
  final rowIndex = _state._rowsStateMapper[itemId];
  if (rowIndex == null) {
    throw TableError(
        'Item with key "$itemId" is not in the current dataset.');
  }

  final row = _state._rowsState[rowIndex];
  final item = _state._items[row.index];
  update(item);

  // refresh state of that row.
  row.refresh();
}