routerGenerate method

Route routerGenerate (
  1. RouteSettings settings
)

generate a route ,you must add this to app.

Implementation

Route<dynamic> routerGenerate(RouteSettings settings) {
  RouteSettings routeSettings = settings;
  if (_interceptors != null) {
    _interceptors.forEach((interceptor) {
      routeSettings = interceptor.onRequest(routeSettings);
    });
  }
  Object params = routeSettings.arguments;
  RRouterWidgetBuilder builder = _routeMap[routeSettings.name];
  if (builder != null) {
    return _pageGenerate(
        routeSettings, (BuildContext context) => builder(params));
  } else {
    try {
      return _pageGenerate(routeSettings,
          (BuildContext context) => notFoundPage?.call(routeSettings.name));
    } catch (_) {
      String error =
          "No registered route was found to handle '${routeSettings.name}'.";
      throw RRouterNotFoundException(error, routeSettings.name);
    }
  }
}