NyRouterRoute constructor
NyRouterRoute({
- required String name,
- required NyRouteView view,
- BaseArguments? defaultArgs,
- List<
RouteGuard> ? routeGuards, - PageTransitionType pageTransitionType = PageTransitionType.rightToLeft,
Implementation
NyRouterRoute(
{required this.name,
required this.view,
this.defaultArgs,
this.routeGuards,
this.pageTransitionType = PageTransitionType.rightToLeft}) {
this.builder = (context, arg) {
Widget widget = view(context);
if (widget is NyStatefulWidget) {
if (widget.controller != null) {
widget.controller!.request =
NyRequest(currentRoute: name, args: arg as NyArgument?);
widget.controller!.construct(context);
}
}
return widget;
};
}