onGenerateRoute method
Implementation
Route<dynamic>? onGenerateRoute(RouteSettings settings, [String? basePath]) {
var match = findMatch(settings);
if (match != null) {
if (basePath != null) {
match = match.copyWith(name: _joinPath(basePath, match.name))
as RouteMatch?;
}
RouteData data;
if (match!.isParent) {
data = ParentRouteData(
matchResult: match,
initialRoute: match.rest,
router: match.routeDef.generator,
);
} else {
data = RouteData(match);
}
return pagesMap[match.routeDef.page!]!(data);
}
return null;
}