NyRouterRoute constructor

NyRouterRoute({
  1. required String name,
  2. required NyRouteView view,
  3. BaseArguments? defaultArgs,
  4. NyQueryParameters? queryParameters,
  5. List<RouteGuard>? routeGuards,
  6. PageTransitionType pageTransitionType = PageTransitionType.rightToLeft,
  7. PageTransitionSettings? pageTransitionSettings,
})

Implementation

NyRouterRoute(
    {required this.name,
    required this.view,
    this.defaultArgs,
    this.queryParameters,
    this.routeGuards,
    this.pageTransitionType = PageTransitionType.rightToLeft,
    this.pageTransitionSettings}) {
  this.builder = (context, arg, queryParameters) {
    Widget widget = view(context);
    if (widget is NyStatefulWidget) {
      if (widget.controller != null) {
        widget.controller!.request = NyRequest(
            currentRoute: name,
            args: arg as NyArgument?,
            queryParameters: queryParameters);
        widget.controller!.construct(context);
      }
    }
    return widget;
  };
}