SectionedListController<K extends Object, Section, Item> constructor
SectionedListController<K extends Object, Section, Item> ({
- required TickerProvider vsync,
- required K sectionKeyOf(
- Section section
- required K itemKeyOf(
- Item item
- Duration animationDuration = const Duration(milliseconds: 300),
- Curve animationCurve = Curves.easeInOut,
- double itemIndent = 0.0,
- bool preserveExpansion = true,
Implementation
SectionedListController({
required TickerProvider vsync,
required this.sectionKeyOf,
required this.itemKeyOf,
Duration animationDuration = const Duration(milliseconds: 300),
Curve animationCurve = Curves.easeInOut,
double itemIndent = 0.0,
bool preserveExpansion = true,
}) : _tree = TreeController<SecKey<K>, SecPayload<Section, Item>>(
vsync: vsync,
animationDuration: animationDuration,
animationCurve: animationCurve,
indentWidth: itemIndent,
),
_preserveExpansion = preserveExpansion {
_sync = TreeSyncController<SecKey<K>, SecPayload<Section, Item>>(
treeController: _tree,
preserveExpansion: preserveExpansion,
);
// Single underlying TreeController node-data listener that fans out
// into the two domain-specific listener lists. Attached unconditionally;
// dispatch is cheap (one type test, one list iteration that is empty
// when nothing subscribes).
_tree.addNodeDataListener(_dispatchPayloadNotification);
}