replace method

void replace(
  1. DrillDownLevel level
)

Replace the current level (in-place update without history push).

Implementation

void replace(DrillDownLevel level) {
  if (_disposed) return;
  if (value.stack.isEmpty) {
    push(level);
    return;
  }
  value = DrillDownState(
    stack: [...value.stack.sublist(0, value.stack.length - 1), level],
  );
}