replaceAll method
Implementation
void replaceAll(
List<PageRouteInfo> routes, PageRouteInfo<dynamic> previousActiveRoute) {
final routesToPush = _matchAllOrReportFailure(routes)!;
_pages.clear();
_childControllers.clear();
_pushAll(routesToPush);
var targetIndex =
routesToPush.indexWhere((r) => r.name == previousActiveRoute.routeName);
if (targetIndex == -1) {
targetIndex = homeIndex == -1 ? 0 : homeIndex;
}
setActiveIndex(targetIndex, notify: false);
}