hideContextGroup method
Hides all contextual tabs belonging to contextGroup. If the active tab
was in that group, the first standard tab becomes active.
Implementation
void hideContextGroup(String contextGroup) {
if (!_visibleContextGroups.remove(contextGroup)) return;
final active =
_state.activeTabIndex >= 0 && _state.activeTabIndex < _def.tabs.length
? _def.tabs[_state.activeTabIndex]
: null;
if (active != null &&
active.isContextual &&
active.contextGroup == contextGroup) {
_state = _state.copyWith(
activeTabIndex: _def.tabs.indexWhere((t) => !t.isContextual),
);
}
repaint();
}