AutoRoute class

A route entry configuration used in RouteMatcher to create RouteMatch's from paths and PageRouteInfo's

Implementers
Annotations

Constructors

AutoRoute({required PageInfo page, String? path, bool usesPathAsKey = false, List<AutoRouteGuard> guards = const [], bool fullMatch = false, RouteType? type, Map<String, dynamic> meta = const {}, bool maintainState = true, bool fullscreenDialog = false, List<AutoRoute>? children, TitleBuilder? title, RestorationIdBuilder? restorationId, bool keepHistory = true, bool initial = false, bool allowSnapshotting = true})
Builds a default AutoRoute instance with any type
factory
AutoRoute.guarded({required PageInfo page, required OnNavigation onNavigation, String? path, bool usesPathAsKey = false, bool fullMatch = false, RouteType? type, Map<String, dynamic> meta = const {}, bool maintainState = true, bool fullscreenDialog = false, List<AutoRoute>? children, TitleBuilder? title, RestorationIdBuilder? restorationId, bool keepHistory = true, bool initial = false, bool allowSnapshotting = true})
Creates an AutoRoute with a single AutoRouteGuard callback
factory

Properties

allowSnapshotting bool
Whether the target route should allow snapshotting. Passed To PageRoute.allowSnapshotting
final
children RouteCollection?
The nested child-entries of this route
no setter
fullMatch bool
Weather to match this route's path as fullMatch
final
fullscreenDialog bool
Whether to treat the target route as a fullscreenDialog. Passed To PageRoute.fullscreenDialog
final
guards List<AutoRouteGuard>
The list of AutoRouteGuard's the matched route will go through before being presented
final
hashCode int
The hash code for this object.
no setterinherited
hasSubTree bool
Whether is route is a parent route
no setter
initial bool
Marks route as initial destination of a router
final
keepHistory bool
Whether the target route should be kept in stack after another route is pushed above it
final
maintainState bool
Whether the target route should maintain it's state. Passed To PageRoute.maintainState
final
meta Map<String, dynamic>
a Map of dynamic data that can be accessed by RouteData.meta when the route is created
final
name String
The name of page this route should map to
final
path String
The path defined by user or automatically-added By RouteCollection.fromList
no setter
restorationId RestorationIdBuilder?
Builds a String value that that's passed to AutoRoutePage.restorationId
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title TitleBuilder?
Builds page title that's passed to _PageBasedCupertinoPageRoute.title where it can be used by CupertinoNavigationBar
final
type RouteType?
Indicates what kind of PageRoute this route will use e.g MaterialRouteType will create _PageBasedMaterialPageRoute
final
usesPathAsKey bool
If set to true the AutoRoutePage will use the matched-path as it's key otherwise name will be used
final

Methods

changePath(String path) AutoRoute
A simplified copyWith
copyWith({RouteType? type, String? name, String? path, bool? usesPathAsKey, List<AutoRouteGuard>? guards, bool? fullMatch, Map<String, dynamic>? meta, bool? maintainState, bool? fullscreenDialog, List<AutoRoute>? children, TitleBuilder? title, RestorationIdBuilder? restorationId, bool? keepHistory, bool? initial, bool? allowSnapshotting}) AutoRoute
A simplified copyWith
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

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