Height_cache keeps track of the rendered height of items so that scrolling to a given position can decide which elements to render accurately. This allows rows to have different heights and change height at runtime.
It only caches heights for rows that are currently in the list with a given key, so items will be dropped on changing a filter or sort, but this is only noticable if the height guess is wrong and the user is paying very close attention to consistency of scroll positions.
The height_guess
parameter is the default height in pixels returned for any item
that is not in the cache. Rows that are measured to be exactly height_guess
tall
will not even be added to the cache. If most of your rows are a certain size you
should determine the exact height returned to measure_heights
in the typical case
and use that as your guess.
val empty : height_guess:float ‑> t