VRouterDelegate class
Inheritance
Mixed in types
Constructors
VRouterDelegate ({required List <VRouteElement > routes , Widget builder (BuildContext context , Widget child )?, List <NavigatorObserver > navigatorObservers = const [] , Future <void > beforeEnter (VRedirector vRedirector ) = VoidVGuard.voidBeforeEnter , Future <void > beforeLeave (VRedirector vRedirector , void saveHistoryState (Map <String , String > historyState ) ) = VoidVGuard.voidBeforeLeave , void afterEnter (BuildContext context , String ? from , String to ) = VoidVGuard.voidAfterEnter , Future <void > onPop (VRedirector vRedirector ) = VoidVPopHandler.voidOnPop , Future <void > onSystemPop (VRedirector vRedirector ) = VoidVPopHandler.voidOnSystemPop , Widget buildTransition (Animation <double > animation , Animation <double > secondaryAnimation , Widget child )?, Duration ? transitionDuration , Duration ? reverseTransitionDuration , String initialUrl = '/' , List <VLogLevel > logs = VLogs.info , GlobalKey <NavigatorState > ? navigatorKey } )
Methods
addListener (VoidCallback listener )
→ void
Register a closure to be called when the object changes.
inherited
build (BuildContext context )
→ Widget
Called by the Router to obtain the widget tree that represents the
current state.
override
dispose ()
→ void
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
historyBack ()
→ void
Goes back 1 in the url history
historyCanBack ()
→ bool
Check whether going back 1 in the history url is possible
historyCanForward ()
→ bool
Check whether going forward 1 in the history url is possible
historyCanGo (int delta )
→ bool
Check whether jumping of delta
in the history url is possible
historyForward ()
→ void
Goes forward 1 in the url history
historyGo (int delta )
→ void
Goes jumps of delta
in the url history
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners ()
→ void
Call all the registered listeners.
inherited
pop ({Map <String , String > pathParameters = const {} , Map <String , String > queryParameters = const {} , String ? hash , Map <String , String > newHistoryState = const {} } )
→ Future <void >
Starts a pop cycle
popRoute ()
→ Future <bool >
handles systemPop
override
push (String newUrl , {Map <String , String > queryParameters = const {} , Map <String , String > historyState = const {} } )
→ void
Pushes the new route of the given url on top of the current one
A path can be of one of two forms:
pushExternal (String newUrl , {bool openNewTab = false } )
→ void
Goes to an url which is not in the app
pushNamed (String name , {Map <String , String > pathParameters = const {} , Map <String , String > queryParameters = const {} , Map <String , String > historyState = const {} } )
→ void
Updates the url given a VRouteElement name
pushReplacement (String newUrl , {Map <String , String > queryParameters = const {} , Map <String , String > historyState = const {} } )
→ void
Replace the current one by the new route corresponding to the given url
The difference with push is that this overwrites the current browser history entry
If you are on mobile, this is the same as push
Path can be of one of two forms:
pushReplacementNamed (String name , {Map <String , String > pathParameters = const {} , Map <String , String > queryParameters = const {} , Map <String , String > historyState = const {} } )
→ void
Replace the url given a VRouteElement name
The difference with pushNamed is that this overwrites the current browser history entry
pushSegments (List <String > segments , {Map <String , String > queryParameters = const {} , Map <String , String > historyState = const {} } )
→ void
Pushes a new url based on url segments
removeListener (VoidCallback listener )
→ void
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
replaceHistoryState (Map <String , String > newHistoryState )
→ void
This replaces the current history state of VRouter with given one
setInitialRoutePath (RouteInformation configuration )
→ SynchronousFuture <void >
Called by the Router at startup with the structure that the
RouteInformationParser obtained from parsing the initial route.
override
setNewRoutePath (RouteInformation routeInformation )
→ Future <void >
Navigation state to app state
override
setRestoredRoutePath (RouteInformation configuration )
→ Future <void >
Called by the Router during state restoration.
inherited
systemPop ({Map <String , String > pathParameters = const {} , Map <String , String > queryParameters = const {} , String ? hash , Map <String , String > newHistoryState = const {} } )
→ Future <void >
Starts a systemPop cycle
to (String path , {Map <String , String > queryParameters = const {} , String ? hash , Map <String , String > historyState = const {} , dynamic isReplacement = false } )
→ void
The main method to navigate to a new path
toExternal (String newUrl , {bool openNewTab = false } )
→ void
Goes to an url which is not in the app
toNamed (String name , {Map <String , String > pathParameters = const {} , Map <String , String > queryParameters = const {} , String ? hash , Map <String , String > historyState = const {} , bool isReplacement = false } )
→ void
pathParameters
needs to specify every path parameters
contained in the path corresponding to name
toSegments (List <String > segments , {Map <String , String > queryParameters = const {} , String ? hash , Map <String , String > historyState = const {} , dynamic isReplacement = false } )
→ void
Navigates to a new url based on path segments
toString ()
→ String
A string representation of this object.
inherited