popTo method

void popTo(
  1. String id
)

Pop back to the level with id, if it exists in the stack.

Implementation

void popTo(String id) {
  if (_disposed) return;
  final idx = value.stack.indexWhere((l) => l.id == id);
  if (idx < 0 || idx == value.stack.length - 1) return;
  value = DrillDownState(stack: value.stack.sublist(0, idx + 1));
}