QRContext class
Properties
activeNavigatorName
↔ String
Set the active navigator name to call with navigator
by default it is the root navigator
For example if you work on a dashboard and you want to do your changes
from now on only on the dashboard Navigator. Then set this value
to the Dashboard Navigator name and every time you call QR.navigator
the Dashboard navigator will be called instated of root navigator
getter/setter pair
context
→ BuildContext ?
Get the current context of the active navigator
no setter
currentPath
→ String
This is the url of the current route
no setter
currentRoute
→ QRoute
Get the current route QRoute of the active navigator navigator
to change the active navigator use activeNavigatorName
no setter
hashCode
→ int
The hash code for this object.
no setter inherited
history
→ QHistory
This history for the navigation. It is internal history to help with
back method . Modifying it does not affect the Browser history
final
navigator
→ QNavigator
Get the active navigator by activeNavigatorName
by default it is the root navigator
For example if you work on a dashboard and you want to do your changes
from now on only on the dashboard Navigator. Then set this value
to the Dashboard Navigator name and every time you call QR.navigator
the Dashboard navigator will be called instated of root navigator
no setter
observer
→ QObserver
Add observer for the navigation or pop
final
params
→ QParams
The parameter for the current route see
final
rootNavigator
→ QNavigator
Get the root navigator
This is the default navigator of the app
no setter
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
settings
→ _QRSettings
The Settings for this package
this will
final
treeInfo
→ _QTreeInfo
Info about the current route tree
This is internal info for the package
Do not modify it unless you know what you are doing
It is used to help with getting the route path from the route name
final
Methods
createDeclarativeRouterController (QKey key )
→ QDeclarativeController
create a state to use with a declarative router
createNavigator (String name , {List <QRoute > ? routes , QRouteChildren? cRoutes , String ? initPath , QRouteInternal? initRoute , List <NavigatorObserver > ? observers , String ? restorationId })
→ Future <QRouter >
return a router QRouter
for the given routes
you do not need to give the initRoute
createRouterController (String name , {List <QRoute > ? routes , QRouteChildren? cRoutes , String ? initPath , QRouteInternal? initRoute })
→ Future <QRouterController >
create a controller to use with a Navigator
getActiveTree ()
→ Widget
return the current tree widget
hasNavigator (String name )
→ bool
Check if navigator with this name exists
isCurrentName (String name , {Map <String , dynamic > ? params })
→ bool
check if the current path is the same as the given name and params
isCurrentPath (String path )
→ bool
check if the current path is the same as the given path
log (String mes , {bool isDebug = false })
→ void
Print a message from the package
navigatorOf (String name )
→ QNavigator
return router for a name
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeNavigator (String name )
→ Future <bool >
Remove a navigator with this name
reset ()
→ void
Clear everything.
setUrlStrategy ()
→ void
Remove the hashtag from url,
call this function before running your app,
Somewhere before calling runApp()
do:
toString ()
→ String
A string representation of this object.
inherited
updateUrlInfo (String url , {Map <String , dynamic > ? params , QKey ? mKey , String ? navigator , bool addHistory = true , bool updateParams = false })
→ void
Update the browser url