setPanelVisible method

void setPanelVisible(
  1. TideId panelId,
  2. bool visible
)

Set the panel visibility.

Implementation

void setPanelVisible(TideId panelId, bool visible) {
  final currentState = state.value;
  if (panelId.id.isEmpty && currentState.panels.length > 1) {
    throw ArgumentError(
        'Tide: TideWorkbenchLayoutService.setPanelVisible panelId cannot be empty');
  }
  TidePanel? newPanel;
  final panel = currentState.getPanel(panelId);
  if (panel != null) {
    newPanel = panel.copyWith(isVisible: visible);
  }

  if (newPanel != null) {
    replacePanel(newPanel);
  }
}