popN method

AFRouteStateSegments popN(
  1. int popCount,
  2. dynamic childReturn
)

Remove the leaf element from the route, returning back to the parent screen.

Implementation

AFRouteStateSegments popN(int popCount, dynamic childReturn) {
  final revised = copyActive();
  final priorLastSegment = _cyclePrior(revised, popCount);
  return copyWith(
    active: revised,
    prior: priorLastSegment
  );
}