selectedKeys property

Set<Object?> selectedKeys
final

Selection is tracked by the identity of the selected item, not by its positional row index. When a paginated consumer swaps in a new page of StandardGrid.data/StandardGrid.items on the same widget instance, the row indices are reused (page 2 row 0 == page 1 row 0), so index-based tracking would make the new page inherit the previous page's selection. Keying on the item avoids that: page 2's items simply aren't in the set. When StandardGrid.items is null we have no stable identity, so we fall back to the positional index as the key.

Implementation

final Set<Object?> selectedKeys = <Object?>{};