GgRouter class
Use GgRouter to connect your widget hierarchy with a nested route tree.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- GgRouter
Constructors
-
GgRouter(Map<
String, Widget Function(BuildContext)> children, {required Key key, Map<String, String> semanticLabels = const {}, String? defaultRoute, GgAnimationBuilder? inAnimation, GgAnimationBuilder? outAnimation, Duration animationDuration = const Duration(milliseconds: 500)}) - Constructor, which takes a map of child routes. Depending on the currently selected routed one of the child routes is shown.
-
GgRouter.from(GgRouter other, {Key? key, Map<
String, String> ? semanticLabels, String? defaultRoute, Map<String, Widget Function(BuildContext)> ? children, GgAnimationBuilder? inAnimation, GgAnimationBuilder? outAnimation, Duration? animationDuration}) - Copies a router object and allows to replace single properties.
- GgRouter.root({Key? key, required Widget child, required GgRouteTreeNode node})
-
This method is called by GgRouterDelegate to create the root instance.
const
Properties
- animationDuration → Duration
-
The duration for route transitions.
final
-
children
→ Map<
String, Widget Function(BuildContext)> -
The child routes of this router.
final
- defaultRoute → String?
-
The default route that is activated, if one navigates to LAST and
no child route was staged before.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- inAnimation → GgAnimationBuilder?
-
This animation is applied to the widget appearing on route transitions.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- outAnimation → GgAnimationBuilder?
-
this animation is applied to the widget disappearing on route transitions.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
semanticLabels
→ Map<
String, String> -
A map assigning a semantic label to each route.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → GgRouterState -
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, int wrapWidth = 65}) → 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
-
of(
BuildContext context, {bool rootRouter = false}) → GgRouterCore - Returns the next GgRouterState instance in the widget tree.
Constants
- noGgRouterDelegateFoundError → const String
- This error message is thrown when you forget to instaniate a GgRouterDelegate before instantiating a GgRouter.