replaceAll method
AFRouteStateSegments
replaceAll(
- AFRouteParam param,
- List<
AFRouteParam> ? children, - AFCreateDefaultChildParamDelegate? createDefaultChildParam
Removes all existing segments in the route, and adds back the specified screen/data.
Implementation
AFRouteStateSegments replaceAll(AFRouteParam param, List<AFRouteParam>? children, AFCreateDefaultChildParamDelegate? createDefaultChildParam) {
// this prevent us from removing afib test screens.
final revised = List<AFRouteSegment>.of(active);
final popCount = this.popCountToRoot;
final priorLastSegment = _cyclePrior(revised, popCount);
revised.add(AFRouteSegment.withParam(param, children, createDefaultChildParam));
return copyWith(
active: revised,
prior: priorLastSegment
);
}