VPath class

If the VRouteElement contains a path, it should extend this class

What is does is:

Inheritance
Annotations

Constructors

VPath({required String? path, List<String> aliases = const [], bool mustMatchStackedRoute = false, required List<VRouteElement> stackedRoutes})

Properties

aliases List<String>
Alternative paths that will be matched to this route
final
aliasesPathParametersKeys List<List<String>>
Parameters of the aliases if any It is created automatically
latefinal
aliasesRegExp List<RegExp>
RegExp version of the aliases It is created automatically If an alias starts with '/', it is removed from this regExp.
latefinal
hashCode int
The hash code for this object.
no setterinherited
mustMatchStackedRoute bool
A boolean to indicate whether this can be a valid VRouteElement of the VRoute if no VRouteElement in its stackedRoute is matched
final
path String?
The path (relative or absolute) or this VRouteElement
final
pathParametersKeys List<String>
Parameters of the path It is created automatically
latefinal
pathRegExp RegExp?
RegExp version of the path It is created automatically If the path starts with '/', it is removed from this regExp.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stackedRoutes List<VRouteElement>
The routes which should be included if the constraint on this path are met
final

Methods

afterEnter(BuildContext context, String? from, String to) → void
This is called after the url and the historyState are updated and this VRouteElement was NOT in the previous route and is in the new route You can't prevent the navigation anymore You can get the new route parameters, and queryParameters
inherited
afterLeave(BuildContext context, String? from, String to) → void
This is called after the url and the historyState are updated and this VRouteElement was in the previous route and is NOT in the new route You can't prevent the navigation anymore You can get the new route parameters, and queryParameters
inherited
afterUpdate(BuildContext context, String? from, String to) → void
This is called after the url and the historyState are updated and this VRouteElement was in the previous route and is in the new route You can't prevent the navigation anymore You can get the new route parameters, and queryParameters
inherited
beforeEnter(VRedirector vRedirector) Future<void>
This is called before the url is updated if this VRouteElement was NOT in the previous route but is in the new route
inherited
beforeLeave(VRedirector vRedirector, void saveHistoryState(Map<String, String> state)) Future<void>
Called when a url changes, before the url is updated Use vRedirector if you want to redirect or stop the navigation. DO NOT use VRouter methods to redirect. vRedirector also has information about the route you leave and the route you go to
inherited
beforeUpdate(VRedirector vRedirector) Future<void>
This is called before the url is updated if this VRouteElement was in the previous route and is in the new route
inherited
buildRoute(VPathRequestData vPathRequestData, {required VPathMatch parentVPathMatch, required bool parentCanPop}) VRoute?
What this buildRoute does is look if any path or alias can give a valid VRoute considering this and the stackedRoutes
override
getConstantLocalPath() String?
If this VRouteElement is in the route but its localPath is null we try to find a local path in path, ...aliases
getNewParentPath(GetNewParentPathResult parentPathResult, {required String? thisPath, required List<String> thisPathParametersKeys, required Map<String, String> pathParameters}) GetNewParentPathResult
The goal is that, considering thisPath and parentPath we can form a new parentPath
getPathFromName(String nameToMatch, {required Map<String, String> pathParameters, required GetNewParentPathResult parentPathResult, required Map<String, String> remainingPathParameters}) GetPathFromNameResult
Tries to find a path from a name
override
getPathFromPop(VRouteElement elementToPop, {required Map<String, String> pathParameters, required GetNewParentPathResult parentPathResult}) VPopResult
VPopResult.didPop is true if this VRouteElement popped VPopResult.extendedPath is null if this path can't be the right one according to the path parameters VPopResult is null when this VRouteElement does not pop AND none of its stackedRoutes popped
override
getPathMatch({required String entirePath, required String? selfPath, required RegExp? selfPathRegExp, required List<String> selfPathParametersKeys, required VPathMatch parentVPathMatch}) VPathMatch
Returns path information given a local path.
getVRouteFromRoutes(VPathRequestData vPathRequestData, {required List<VRouteElement> routes, required VPathMatch vPathMatch, required bool parentCanPop}) VRoute?
Searches for a valid VRoute by asking VRouteElements is routes if they can form a valid VRoute
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onPop(VRedirector vRedirector) Future<void>
Called when a pop event occurs A pop event can be called programmatically (with VRouter.of(context).pop()) or by other widgets such as the appBar back button
inherited
onSystemPop(VRedirector vRedirector) Future<void>
Called when a system pop event occurs. This happens on android when the system back button is pressed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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