NavigationRouter class

NavigationRouter is the widget core for navigator 2.0 implementation

Inheritance

Constructors

Is used to create a new instance of NavigationRouter
const

Properties

child NavigationWidgetMixin
NavigationRouter.child is used to build a Router to handle the navigator 2.0
final
hashCode int
The hash code for this object.
no setterinherited
initialPage String
NavigationRouter.initialPage is used to render the page that has the same path. If the PageWidget.build returns a router without a RouteInformationProvider it will not work correctly. Defaults to "/"
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
NavigationRouter.navigatorObservers is used to observer the navigator 2.0 when navigating between screens. Defaults to List.empty()
final
pages List<NavigationPage>
NavigationRouter.pages is used to create pages that can be accessed by the navigator 2.0
final
restorationScopeId String?
NavigationRouter.restorationScopeId is used to save and restore the navigator 2.0 state, if it is null then the state will not be saved. Defaults to null
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
transitionDuration Duration
transitionDuration is used to controls the animation transition. Defaults to Duration(milliseconds: 400)
final
transitionsBuilder RouteTransitionsBuilder?
NavigationRouter.transitionsBuilder is used to build a global custom animation transition when navigating to another page. Defaults: if the platform is web then will not have any transition else will be null
final
unknownPage NavigationPage?
NavigationRouter.unknownPage is used to create an unknownPage with the given path
final
useHash bool
NavigationRouter.useHash If it is true then will be used the default url strategy that is a path with hash, for example: flutterexample.dev/#/path/to/screen, otherwise will be flutterexample.dev/path/to/screen. Defaults to false
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _NavigationRouterState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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

Static Methods

defaultWebTransition(BuildContext context, Animation<double> animation, Animation<double> secondaryAnimation, Widget child) Widget
NavigationRouter.defaultWebTransition is used to get the default web transition that means it does not have any transition when navigating between screens