NyRouterRoute constructor
NyRouterRoute({
- required String name,
- required NyRouteView view,
- BaseArguments? defaultArgs,
- NyQueryParameters? queryParameters,
- List<
RouteGuard> ? routeGuards, - PageTransitionType pageTransitionType = PageTransitionType.rightToLeft,
- 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;
};
}