Skip to content

notFoundHanler == null #269

@LatCui

Description

@LatCui

`AppRouteMatch? match = _routeTree.matchRoute(path!);
AppRoute? route = match?.route;
if (transitionDuration == null && route?.transitionDuration != null) {
transitionDuration = route?.transitionDuration;
}

Handler handler = (route != null ? route.handler : notFoundHandler);
TransitionType? transition = transitionType;
if (transitionType == null) {
  transition = route != null ? route.transitionType : TransitionType.native;
}
if (route == null && notFoundHandler == null) {
  return RouteMatch(
      matchType: RouteMatchType.noMatch,
      errorMessage: "No matching route was found");
}
Map<String, List<String>> parameters =
    match?.parameters ?? <String, List<String>>{};
if (handler.type == HandlerType.function) {
  handler.handlerFunc(buildContext, parameters);
  return RouteMatch(matchType: RouteMatchType.nonVisual);
}`

if notFoundHandler == null && route == null,
Handler handler = (route != null ? route.handler : notFoundHandler);
shoud use Handler? handler ,or if (route == null && notFoundHandler == null) can’t execute

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions