notifyNodeExpanding method

Range notifyNodeExpanding (
  1. T node,
  2. void expandFn(
      ),
    1. {int index,
    2. AnimatedListController controller}
    )

    This method has to be called when the node is about to be expanded. Pass your function to expandFn that takes care of actually expanding the node. If you also have the index of the corresponding list view item, that's better pass it through the index attribute, otherwise you can just omit it. If you pass a controller, the linked animated list view will be automatically notified. If you don't pass a controller, a Range will be returned to indicate the range of items of the list view involved in the modification.

    Implementation

    Range notifyNodeExpanding(T node, void Function() expandFn,
        {int index, AnimatedListController controller}) {
      index = _ensureIndex(node, index);
      final from = index + (includeRoot ? 0 : 1); // first child index
      final to = from + _countSubNodesOf(node);
      return _notify(from, to, node, expandFn, index, controller, _insert,
          (from, count) {
        controller.notifyInsertedRange(from, count);
      });
    }