voyager library

Classes

AbstractRouteContext<P>
The class supplied to custom callbacks to describe the route route
AbstractRouter<O, P>
Base router implementation for given output/parameter. Ported from eyeem/router OSS project and improved upon.
OutputBuilder<O, P>
The class used when you want to map a function (given in run) to a Router URL.
PagePlugin
page plugin, allows voyager to understand page mappings you provide in your yaml file
PagePluginBuilder
utility class for easier WidgetPlugin creation
RedirectPlugin
redirect plugin
RouterParams<O, P>
class containg broken down parameters and builder, a result of path lookup
Voyager
This class is a composite product of RouterPlugins for the given router's path - this means all the information resolved from the navigation file that is relevant to creating new widget. Once assembled the variables are locked - they can be read but you can't put more.
VoyagerAdapter<T>
serializes and deserializes given type
VoyagerArgument
wrapper class for argument passed via navigator or in the constructor of VoyagerWidget
VoyagerBuilder
a builder that is registered at VoyagerRouter's each path, this creates Voyager from the config that is hidden behind the path using all the plugins that are available in VoyagerRouter
VoyagerContext
voyager context, accessible for plugins, contains relevant information
VoyagerDelegate
Voyager delegate for the Navigator 2.0 Router
VoyagerInformationParser
Voyager's implementation of navigation parser. Essentially translates RouteInformation to/from VoyagerPage
VoyagerNothing
nothingness, void, empty space
VoyagerObjectPlugin<T>
just like VoyagerPlugin but expects you to produce an instance of T allows performing disposal thru onDispose method
VoyagerPage
an outcome of parsing RouteInformation
VoyagerParam
Mid value passed to VoyagerBuilder where it's used to construct final Voyager instance
VoyagerPath
a build piece of VoyagerRouter
VoyagerPlugin<VoyagerExtended extends Voyager>
VoyagerPlugin allows parsing nodes located under individual paths and putting them inside Voyager instance
VoyagerRouter
contains navigation map and plugins, resolves requested paths to instances of Voyager
VoyagerScope
a VoyagerStack can expose a scope to all its items
VoyagerScopeRemovable
use this interface to free up scope if necessary
VoyagerStack
respresents the state of navigation
VoyagerStackApp
Provides declarative API on top of Navigator 2.0 and Voyager library
VoyagerStackItem
voyager stack basic building bloc
VoyagerUtils
Common utils used throught Voyager package
VoyagerWidget
Just like VoyagerStatelessWidget but stateful. It has additional parameter called keepAlive which is usefull when embedding the widget in things like TabBarView. Most of the time you don't want this. Retains Voyager unless path or router changes
WidgetPlugin
widget plugin, allows voyager to understand widget mappings you provide in your yaml file
WidgetPluginBuilder
utility class for easier WidgetPlugin creation

Enums

VoyagerRouteType
voyager route type

Extensions

VoyagerArgumentExtension on BuildContext
allows access to voyager argument from build context
VoyagerContextExtension on BuildContext
Voyager default extension on build context
VoyagerStackScopeContextExtension on BuildContext
VoyagerStack extension on build context

Functions

loadPathsFromAssets(String path, {AssetBundle? assetBundle}) Future<List<VoyagerPath>>
loads voyager paths from yaml file in assets asynchronously where path is e.g. "assets/navigation.yml"
loadPathsFromJsonString(String json) Future<List<VoyagerPath>>
loads voyager paths from yaml string asynchronously
loadPathsFromJsonSync(String jsonString) List<VoyagerPath>
loads voyager paths from json string synchronously
loadPathsFromYamlString(String yaml) Future<List<VoyagerPath>>
loads voyager paths from yaml string asynchronously
loadPathsFromYamlSync(String yaml) List<VoyagerPath>
loads voyager paths from yaml string synchronously
loadRouter(Future<List<VoyagerPath>> paths, List<VoyagerPlugin<Voyager>> plugins, {VoyagerFactory<Voyager>? voyagerFactory}) Future<VoyagerRouter>
given paths and plugins resolves you a router.

Typedefs

ProgrammaticVoyagerFactory<T extends Voyager> = T Function(AbstractRouteContext abstractContext, VoyagerContext context)
creates voyager instance, can be used to supply Voyager subclasses
VoyagerConfig<T extends Voyager> = void Function(VoyagerContext context, T voyager)
allows programmatic path specification
VoyagerDelegateNavigatorWrapper = Widget Function(BuildContext context, Navigator navigator, VoyagerDelegate delegate)
allows wrapping widget around navigator returned by VoyagerDelegate
VoyagerFactory<T extends Voyager> = T Function(AbstractRouteContext abstractContext, Map<String, dynamic> config)
alias for creating programatic voyager instances
VoyagerPageBuilder = Page Function(Widget widget, VoyagerPage page)
allows wrapping VoyagerWidget with a Page

Exceptions / Errors

RouteNotFoundException
Thrown if a given route is not found.