updateDeclarativeRoutes method
Implementation
void updateDeclarativeRoutes(List<PageRouteInfo> routes) async {
_pages.clear();
final routesToPush = <RouteMatch>[];
for (var route in routes) {
var match = _matchOrReportFailure(route);
if (match == null) {
break;
}
if (match.guards.isNotEmpty) {
throw FlutterError("Declarative routes can not have guards");
}
routesToPush.add(match);
final data = _createRouteData(match, routeData);
_pages.add(pageBuilder(data));
}
navigationHistory.onNewUrlState(
UrlState.fromSegments(
root.currentSegments,
shouldReplace: current == routeData,
),
notify: false,
);
}