findChildIndexCallback property

(int? Function(Key)?) findChildIndexCallback
final

Called to find the new index of a child based on its key in case of reordering.

If not provided, a child widget may not map to its existing RenderObject when the order of children returned from the children builder changes. This may result in state-loss.

This callback should take an input Key, and it should return the index of the child element with that associated key, or null if not found.

Implementation

final int? Function(Key)? findChildIndexCallback;