Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notFoundHanler == null #269

Open
LatCui opened this issue May 17, 2022 · 0 comments
Open

notFoundHanler == null #269

LatCui opened this issue May 17, 2022 · 0 comments

Comments

@LatCui
Copy link

LatCui commented May 17, 2022

`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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant