VoyagerRouter class

contains navigation map and plugins, resolves requested paths to instances of Voyager

Inheritance

Constructors

VoyagerRouter({VoyagerFactory<Voyager> voyagerFactory = _defaultFactory})
default constructor
VoyagerRouter.from(List<VoyagerPath> paths, List<VoyagerPlugin<Voyager>> plugins, {VoyagerFactory<Voyager>? voyagerFactory})
synchronous VoyagerRouter factory
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
voyagerFactory VoyagerFactory<Voyager>
voyager factory
final

Methods

clearCache() → void
clears cache
inherited
find(String path, {Voyager? parent, VoyagerArgument? argument}) Voyager?
lookup path
findCached(String routerPath) Voyager?
lookup path in cache
generator({VoyagerRouteType routeType = VoyagerRouteType.material}) RouteFactory
method's output should be passed to MaterialApp.onGenerateRoute or CupertinoApp.onGenerateRoute
getGlobalEntity(String key) → dynamic
obtain a global entity by key
getPlugins() Map<String, VoyagerPlugin<Voyager>>
obtain registered plugins
globalParam(String key, dynamic object) AbstractRouter
adds a global param accessible to anyone having a hold of this router instance
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
outputFor(String path, {VoyagerParam? extras}) Voyager
Open a map'd URL set using {@link #map(String, Class)} or {@link #map(String, BundleBuilder)}
inherited
paramsForUrl(String url) RouterParams<Voyager, VoyagerParam>
Takes a url (i.e. "/users/16/hello") and breaks it into a {@link RouterParams} instance where each of the parameters (like ":id") has been parsed.
inherited
registerBuilder(String format, OutputBuilder<Voyager, VoyagerParam> builder) → void
Map a URL to an OutputBuilder
inherited
registerConfig<T extends Voyager>(String path, VoyagerConfig<T> voyagerConfig, [ProgrammaticVoyagerFactory<T>? voyagerFactory]) → void
register a VoyagerConfig mapping with a custom ProgrammaticVoyagerFactory
registerGlobalEntity(String key, dynamic value) VoyagerRouter
register a global entity
registerPath(VoyagerPath path) → void
register a VoyagerPath mapping
registerPlugin(VoyagerPlugin<Voyager> plugin) VoyagerRouter
register a plugin
toString() String
A string representation of this object.
inherited

Operators

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