VRedirector class
A class which helps you in beforeLeave or beforeEnter functions This class contain 2 main functionality:
- It allows you to redirect using VRedirector.to, VRedirector.toNamed, ...
- It gives you access to information about the previous route and the new route
Note that you should use this object to redirect in beforeLeave and beforeEnter. Never use VRouterData to do so.
- Implemented types
Constructors
- VRedirector({required String? fromUrl, required String? toUrl, required VRedirectorData? previousVRouterData, required VRedirectorData? newVRouterData, required VRouterDelegate vRouterDelegate})
Properties
- from → String?
-
The url we are coming from
no setter
- fromUrl → String?
-
The url we are coming from
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- newVRouterData → VRedirectorData?
-
The VRouterSailor of the new route
Useful information is:
final
- previousVRouterData → VRedirectorData?
-
The VRouterSailor of the previous route
Useful information is:
final
- redirectFunction → (void Function({required VRouteElementNode vRouteElementNode, required VRouterDelegate vRouterDelegate})?)
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldUpdate → bool
-
no setter
- toUrl → String?
-
The url we are going to
final
Methods
-
historyBack(
) → void -
Goes back 1 in the url history
override
-
historyCanBack(
) → bool -
Check whether going back 1 in the history url is possible
override
-
historyCanForward(
) → bool -
Check whether going forward 1 in the history url is possible
override
-
historyCanGo(
int delta) → bool -
Check whether jumping of
delta
in the history url is possibleoverride -
historyForward(
) → void -
Goes forward 1 in the url history
override
-
historyGo(
int delta) → void -
Goes jumps of
delta
in the url historyoverride -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
{Map< String, String> pathParameters = const {}, Map<String, String> queryParameters = const {}, String? hash, Map<String, String> newHistoryState = const {}}) → void -
Prevent the current redirection and call pop instead
override
-
push(
String newUrl, {Map< String, String> queryParameters = const {}, Map<String, String> historyState = const {}}) → void -
Prevent the current redirection and push a route instead
override
-
pushExternal(
String newUrl, {bool openNewTab = false}) → void -
Prevent the current redirection and pushExternal instead
override
-
pushNamed(
String name, {Map< String, String> pathParameters = const {}, Map<String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}}) → void -
Prevent the current redirection and pushNamed a route instead
override
-
pushReplacement(
String newUrl, {Map< String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}}) → void -
Prevent the current redirection and pushReplacement a route instead
override
-
pushReplacementNamed(
String name, {Map< String, String> pathParameters = const {}, Map<String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}}) → void -
Prevent the current redirection and pushReplacementNamed a route instead
override
-
pushSegments(
List< String> segments, {Map<String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}}) → void -
Prevent the current redirection and push a new url based on url segments
override
-
replaceHistoryState(
Map< String, String> historyState) → void -
This replaces the current history state of VRouter with given one
override
-
stopRedirection(
) → void - Stops the redirection
-
systemPop(
{Map< String, String> pathParameters = const {}, Map<String, String> queryParameters = const {}, String? hash, Map<String, String> newHistoryState = const {}}) → Future<void> -
Prevent the current redirection and call systemPop instead
override
-
to(
String path, {Map< String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}, bool isReplacement = false}) → void -
Prevent the current redirection and redirects to
path
insteadoverride -
toExternal(
String url, {bool openNewTab = false}) → void -
Prevent the current redirection and redirects to the
external
url
insteadoverride -
toNamed(
String name, {Map< String, String> pathParameters = const {}, Map<String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}, bool isReplacement = false}) → void -
Prevent the current redirection and redirects to the VRouteElement
with
name
insteadoverride -
toSegments(
List< String> segments, {Map<String, String> queryParameters = const {}, String? hash, Map<String, String> historyState = const {}, dynamic isReplacement = false}) → void -
Prevent the current redirection and redirects to the new path
composed of the url-encoded
segments
insteadoverride -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited