findChildIndexCallback property Null safety

ChildIndexGetter? 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 in which children are returned from 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 ChildIndexGetter? findChildIndexCallback;