Skip to main content

grouping_sections

Function grouping_sections 

Source
pub fn grouping_sections<T, K, F>(
    model: &ListModel<T>,
    key_fn: F,
) -> GroupingSections
where T: 'static, K: ToString + PartialEq + 'static, F: Fn(&T) -> K + 'static,
Expand description

Build a SectionProvider by grouping consecutive items of model that share a key_fn value into one section, titled by the key. The model is not sorted — callers should pre-sort if they want fully-grouped sections.