tree_state_router library
A routing library that supports declarative routing based on the state transitions of a
TreeStateMachine.
Classes
- BuildForError
- Indicates that page content is being built in order to display a navigator error page.
- BuildForLoading
- Indicates that page content is being built in order to display a navigator loading page.
- BuildForRoute
- Indicates that page content is being built to visualize a StateRoute.
-
DataRoutePath<
D> Web Apps Deep Linking - Describes how a DataStateRoute integrates with platform (i.e. Navigator 2.0) routing.
-
DataStateRoute<
D> Routes - A route that creates visuals for a data state in a state tree.
-
DataStateRoute2<
D, DAnc1> -
A route that creates visuals for a data state, using state data of type
DandDAnc1obtained from the data state, and an ancestor data state. -
DataStateRoute3<
D, DAnc1, DAnc2> -
A route that creates visuals for a data state, using state data of type
D,DAnc1andDAnc2obtained from the data state, and two ancestor data states. - DescendantStatesRouter
- A routing widget that provides visuals for the active states in a state tree, intended for use as a descendant of a top-level TreeStateRouter.
- PageBuildFor
- Describes the reason a page is being built.
- RoutePath Web Apps Deep Linking
- Describes how a StateRoute integrates with platform (i.e. Navigator 2.0) routing.
- RoutePathInfo
- A description of the URI path segment for a state route, when a route tree is enabled for platform routing with TreeStateRouter.platformRouting.
- StateRoute Routes
- A route that provides visuals for a state in a state tree.
-
StateRoute1<
DAnc> -
A route that creates visuals for a state in a state tree, using state data
of type
DAncobtained from an ancestor data state. -
StateRoute2<
DAnc1, DAnc2> -
A route that creates visuals for a state in a state tree, using state data of type
DAnc1andDAnc2obtained from two ancestor data states. -
StateRoute3<
DAnc1, DAnc2, DAnc3> -
A route that creates visuals for a state in a state tree, using state data of type
DAnc1,DAnc2, andDAnc3obtained from three ancestor data states. - StateRouteInfo
- A generalized description of a route that can be placed in a TreeStateRouter.
- StateRouteInfoBuilder
- Provides support for building a StateRouteInfo that describes a route in a TreeStateRouter.
- StateRoutingContext
-
Provides information about the current route, including the current state
of a
TreeStateMachine. - StateRoutingContextProvider
- Provides a StateRoutingContext value to descendant widgets.
- StateTreeInspector
- A widget that displays diagnostic information about a tree state machine.
-
TransitionsBuilderPage<
T> - A Page that allows for customization of route transition animations.
- TreeStateRoutePath
- Provides information about a path of StateRouteInfos that is parsed from RouteInformation provided by the system.
- TreeStateRouter Getting Started
-
Routing information that describes how to display states in a
TreeStateMachine, and triggers routing navigation in response to state transitions within the state machine.
Extensions
- MessageContextRoutingExtensions on MessageContext
-
Extensions on
MessageContextrelated to routing. - TransitionRoutingExtensions on Transition
-
Extensions on
Transitionrelated to routing.
Constants
- isPushTransitionKey → const String
-
The
Transition.metadatakey used to record that a transition was sourced from MessageContextRoutingExtensions.pushGoTo. - popMessageKey → const String
-
The
Transition.metadatakey used to record the message that should be posted to the state machine, when a transition sourced from MessageContextRoutingExtensions.pushGoTo is popped. - rootLoggerName → const String
-
The name of the root logger used by the
tree_state_routerpackage.
Typedefs
-
DataStateRouteBuilder<
D> = Widget Function(BuildContext context, StateRoutingContext stateContext, D data) - A function that can build a widget providing a visualization of an active data state in a state tree.
-
DataStateRouteBuilder2<
D, DAnc> = Widget Function(BuildContext context, StateRoutingContext stateContext, D data, DAnc ancestorData) - A function that can build a widget providing a visualization of an active data state in a state tree.
-
DataStateRouteBuilder3<
D, DAnc1, DAnc2> = Widget Function(BuildContext context, StateRoutingContext stateContext, D data, DAnc1 ancestor1Data, DAnc2 ancestor2Data) - A function that can build a widget providing a visualization of an active data state in a state tree.
-
DataStateRoutePageBuilder<
D> = Page< void> Function(BuildContext context, Widget wrapPageContent(DataStateRouteBuilder<D> buildPageContent)) - A function that can build a routing Page that provides a visualization of an active data state in a state tree.
-
DataStateRoutePageBuilder2<
D, DAnc> = Page< void> Function(BuildContext context, Widget wrapPageContent(DataStateRouteBuilder2<D, DAnc> buildPageContent)) - A function that can build a routing Page that provides a visualization of an active data state in a state tree.
-
DataStateRoutePageBuilder3<
D, DAnc1, DAnc2> = Page< void> Function(BuildContext context, Widget wrapPageContent(DataStateRouteBuilder3<D, DAnc1, DAnc2> buildPageContent)) - A function that can build a routing Page that provides a visualization of an active data state in a state tree.
-
DefaultPageBuilder
= Page<
void> ? Function(PageBuildFor buildFor, Widget pageContent) - A function that can create a Page to display the content of a route.
- DefaultScaffoldingBuilder = Widget Function(PageBuildFor buildFor, Widget pageContent)
- A function that can adorn the content of a route page, adding common layout or scaffolding.
-
GenerateDataPathArgs<
D> = Map< String, String> Function(D data) - A function that can build a map of parameter values that will be used when generating a URI from a DataRoutePath.pathTemplate. The function is provided the current data value of the data route.
-
GenerateInitialData<
D> = D Function(Map< String, String> pathArgs) - A function that can build a generate an initial state data value from path arguments parsed from a URI. This is used if a data route has been declared as eligible for deep-linking.
-
GeneratePathArgs
= Map<
String, String> Function() - A function that can build a map of parameter values that will be used when generating a URI from a RoutePath.pathTemplate.
-
ShellDataStateRouteBuilder<
D> = Widget Function(BuildContext context, StateRoutingContext stateContext, Widget childRouter, D data) -
ShellDataStateRoutePageBuilder<
D> = Page< void> Function(BuildContext context, Widget wrapPageContent(ShellDataStateRouteBuilder<D> buildPageContent)) - ShellStateRouteBuilder = Widget Function(BuildContext context, StateRoutingContext stateContext, Widget nestedRouter)
- A function that can build a widget providing a visualization of an active parent state in a state tree, wrapping a nested router that displays active descendant states. This enables shell or layout pages associated with a parent state to provide a common framing around the visual for descendant states.
-
ShellStateRoutePageBuilder
= Page<
void> Function(BuildContext context, Widget wrapPageContent(ShellStateRouteBuilder buildPageContent)) - StateRouteBuilder = Widget Function(BuildContext context, StateRoutingContext stateContext)
- A function that can build a widget providing a visualization of an active state in a state tree.
-
StateRoutePageBuilder
= Page<
void> Function(BuildContext context, StateRoutePageWrapper wrapPageContent) - A function that can build a routing Page that provides a visualization of an active state in a state tree.
- StateRoutePageWrapper = Widget Function(StateRouteBuilder buildPageContent)
- A function that can wrap content to be displayed in a routing Page with a specialized widget that detects state machine transitions and re-renders the route as necessary.
-
TransitionsBuilder
= Widget Function(BuildContext context, Animation<
double> animation, Animation<double> secondaryAnimation, Widget child) -
A function that can wraps the
childwith one or more transition widgets which define how a Route arrives on and leaves the screen.
Exceptions / Errors
- RoutePathError
- The error thrown when a RoutePathInfo is misconfigured.