setActiveTab method
Switches to the tab at index (if it is currently visible).
Implementation
void setActiveTab(int index) {
if (index < 0 || index >= _def.tabs.length) return;
if (_layout!.tabs.every((t) => !identical(t.tab, _def.tabs[index]))) return;
_state = _state.copyWith(activeTabIndex: index, hoveredTabIndex: -1);
onEvent?.call(TabChangedEvent(index));
repaint();
}