NamedRouteDef class
Builds an AutoRoute instance with a direct page builder
this is meant to be used for simple routes that don't need code generation
Constructors
-
NamedRouteDef.new({String? path, required String name, bool fullscreenDialog = false, bool maintainState = true, bool fullMatch = false, List<
AutoRouteGuard> guards = const [], bool usesPathAsKey = false, List<AutoRoute> ? children, Map<String, dynamic> meta = const {}, TitleBuilder? title, bool keepHistory = true, bool initial = false, bool allowSnapshotting = true, RestorationIdBuilder? restorationId, RouteType? type, required WidgetBuilderWithData builder}) - Default constructor
-
NamedRouteDef.guarded({String? path, required String name, bool fullscreenDialog = false, bool maintainState = true, bool fullMatch = false, bool usesPathAsKey = false, List<
AutoRoute> ? children, Map<String, dynamic> meta = const {}, TitleBuilder? title, bool keepHistory = true, bool initial = false, bool allowSnapshotting = true, RestorationIdBuilder? restorationId, RouteType? type, required WidgetBuilderWithData builder}) - Creates a guarded route
-
NamedRouteDef.shell({required String name, String? path, bool fullscreenDialog = false, bool maintainState = true, bool fullMatch = false, bool usesPathAsKey = false, required List<
AutoRoute> ? children, List<AutoRouteGuard> guards = const [], Map<String, dynamic> meta = const {}, TitleBuilder? title, bool keepHistory = true, bool initial = false, bool allowSnapshotting = true, RestorationIdBuilder? restorationId, RouteType? type}) - Creates a guarded route
Properties
- allowSnapshotting → bool
-
Whether the target route should allow snapshotting.
Passed To PageRoute.allowSnapshotting
finalinherited
- builder → AutoRoutePageBuilder
-
Returns the Widget builder function of the page
no setterinherited
-
children
→ List<
AutoRoute> ? -
The list of AutoRoute children of this route
finalinherited
- fullMatch → bool
-
Weather to match this route's path as fullMatch
finalinherited
- fullscreenDialog → bool
-
Whether to treat the target route as a fullscreenDialog.
Passed To PageRoute.fullscreenDialog
finalinherited
-
guards
→ List<
AutoRouteGuard> -
The list of AutoRouteGuard's the matched route
will go through before being presented
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasSubTree → bool
-
Whether is route is a parent route
no setterinherited
- initial → bool
-
Marks route as initial destination of a router
finalinherited
- keepHistory → bool
-
Whether the target route should be kept in stack
after another route is pushed above it
finalinherited
- maintainState → bool
-
Whether the target route should maintain it's state.
Passed To PageRoute.maintainState
finalinherited
-
meta
→ Map<
String, dynamic> -
a Map of dynamic data that can be accessed by
RouteData.meta when the route is created
finalinherited
- name → String
-
Helper getter to get the name of the page
no setterinherited
- page → PageInfo
-
The name of page this route should map to
finalinherited
- path → String
-
The path defined by user or automatically-added
By RouteCollection.fromList
no setterinherited
- restorationId → RestorationIdBuilder?
-
Builds a String value that that's passed to
AutoRoutePage.restorationId
finalinherited
- 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 CupertinoNavigationBarfinalinherited - type → RouteType?
-
Indicates what kind of PageRoute this route will use
e.g MaterialRouteType will create
_PageBasedMaterialPageRoute
finalinherited - usesPathAsKey → bool
-
If set to true the AutoRoutePage will use the matched-path
as it's key otherwise name will be used
finalinherited
Methods
-
buildPage<
T> (RouteData data) → AutoRoutePage< T> -
Builds a AutoRoutePage from RouteData
inherited
-
changePath(
String path) → AutoRoute -
A simplified copyWith
inherited
-
copyWith(
{RouteType? type, PageInfo? page, 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
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited