setPanelHovered static method

void setPanelHovered(
  1. int level,
  2. bool hovered, {
  3. Object? rootId,
})

Implementation

static void setPanelHovered(int level, bool hovered, {Object? rootId}) {
  final key = rootId ?? _defaultRoot;
  final state = _getOrCreateState(key);
  if (hovered) {
    state.hoveredLevels.add(level);
    state.closeTimer?.cancel();
    // Also cancel ancestor timers
    Object? parent = state.parentRootId;
    while (parent != null) {
      _roots[parent]?.closeTimer?.cancel();
      parent = _roots[parent]?.parentRootId;
    }
  } else {
    state.hoveredLevels.remove(level);
    if (!isBranchHovered(key)) {
      scheduleHide(rootId: key);
    }
  }
}