setPanelHovered static method
void
setPanelHovered(
- int level,
- bool hovered, {
- 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);
}
}
}