goToPane method

void goToPane(
  1. FxPane pane
)

Implementation

void goToPane(FxPane pane) {
  if (pane.isChromeOnly) return;

  final resolved = state.paneByKey(pane.key) ?? pane;
  if (resolved.builder == null && resolved.onPressed == null) return;

  final key = resolved.key;
  if (key == state.currentPane?.key) return;

  final nextHistory = state.history.isEmpty
      ? [key]
      : [...state.history, key];

  state = state.copyWith(
    currentPane: resolved,
    history: nextHistory,
  );
}