NyRouter class

NyRouterRoute manages routing, registering routes with transitions, navigating to routes, closing routes. It is a thin layer on top of Navigator to help you encapsulate and manage routing at one place.

Constructors

NyRouter({NyRouterOptions options = const NyRouterOptions()})

Properties

hashCode int
The hash code for this object.
no setterinherited
no setter
options NyRouterOptions
Configuration options for NyRouterRoute.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addRoutes(List<NyRouterRoute> routes) → void
Add a list of routes at once.
call<T>(String name, {BaseArguments? args, NavigationType navigationType = NavigationType.push, dynamic result, bool removeUntilPredicate(Route route)?, Map<String, dynamic>? params, PageTransitionType? pageTransitionType}) Future<T>
Makes this a callable class. Delegates to navigate.
generator() RouteFactory
Generates the RouteFactory which builds a Route on request.
getRegisteredRouteNames() List<String>
Get the registered routes names as a list.
getRegisteredRoutes() Map<String, NyRouterRoute>
Get the registered routes as a list.
Function used to navigate pages.
Push multiple routes at the same time.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
page(NyStatefulWidget widget, {PageTransitionType? transition, List<RouteGuard>? routeGuards}) → dynamic
Add a new page to the router.
pop([dynamic result]) → void
Delegation for Navigator.pop.
popUntil(void predicate(Route)) → void
Delegation for Navigator.popUntil.
route(String name, NyRouteView view, {PageTransitionType? transition, List<RouteGuard>? routeGuards}) → dynamic
Add a new route with a widget.
setNyRoutes(NyRouter router) → void
Set the registered routes.
setRegisteredRoutes(Map<String, NyRouterRoute> routes) → void
Set the registered routes.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

args<T extends BaseArguments?>(BuildContext context) → T?
Retrieves the arguments passed in when calling the navigate function.
unknownRouteGenerator() RouteFactory