SectionedListController<K extends Object, Section, Item> constructor

SectionedListController<K extends Object, Section, Item>({
  1. required TickerProvider vsync,
  2. required K sectionKeyOf(
    1. Section section
    ),
  3. required K itemKeyOf(
    1. Item item
    ),
  4. Duration animationDuration = const Duration(milliseconds: 300),
  5. Curve animationCurve = Curves.easeInOut,
  6. double itemIndent = 0.0,
  7. 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);
}