applyExpansionBehavior method

Future<void> applyExpansionBehavior(
  1. ITreeNode<Data> item
)

Implementation

Future<void> applyExpansionBehavior(ITreeNode<Data> item) async {
  switch (expansionBehavior) {
    case ExpansionBehavior.none:
      break;
    case ExpansionBehavior.scrollToLastChild:
      await scrollToLastVisibleChild(item);
      break;
    case ExpansionBehavior.snapToTop:
      await snapToTop(item);
      break;
    case ExpansionBehavior.collapseOthers:
      await collapseAllOtherSiblingNodes(item);
      break;
    case ExpansionBehavior.collapseOthersAndSnapToTop:
      await collapseAllOtherSiblingNodes(item);
      await snapToTop(
        item,
        delay: animationDuration + Duration(milliseconds: 100),
      );
      break;
  }
}