VPageBase class
A VRouteElement similar to VWidgetBase but which allows you to specify your own page thanks to pageBuilder
- Inheritance
-
- Object
- VRouteElement
- VPageBase
Constructors
-
VPageBase({required Page pageBuilder(LocalKey key, Widget child, String? name), required Widget widget, LocalKey? key, String? name, List<
VRouteElement> stackedRoutes = const []}) -
VPageBase.builder({required Page pageBuilder(LocalKey key, Widget child, String? name), required Widget builder(BuildContext context, VRouterData state), LocalKey? key, String? name, List<
VRouteElement> stackedRoutes = const []})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → LocalKey?
-
A LocalKey that will be given to the page which contains the given
_rootVRouter
final - mustHaveSubRoutes → bool
-
Describes whether this VRouteElement can be a node of a VRoute
no setter
- name → String?
-
A name for the route which will allow you to easily navigate to it
using VRouter.of(context).pushNamed
final
- pageBuilder → Page Function(LocalKey key, Widget child, String? name)
-
A function which allows you to use your own custom page
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stackedRoutes
→ List<
VRouteElement> -
final
- widget → Widget
-
The widget which will be displayed for the given
path
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 toinherited -
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? -
This is basically the same as VPath.buildRoute except that
we add the page of this VRouteElement as a page to VRoute.pages
inherited
-
buildRoutes(
) → List< VRouteElement> - The list of possible routes Only one will be chosen to be displayed
-
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
inherited
-
getPathFromPop(
VRouteElement elementToPop, {required Map< String, String> pathParameters, required GetNewParentPathResult parentPathResult}) → VPopResult -
VPopResult.didPop
is true if this VRouteElement poppedVPopResult.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 poppedinherited -
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