RouteInfo class
Defines configuration for a navigation route.
Routes are the building blocks of your navigation system. They define how screens are built, when redirects occur, and how deep links are handled.
Use the @RT annotation on static RouteInfo fields to include them in
code generation.
Constructors
-
RouteInfo(String name, {ScreenTitleBuilder? title, ScreenWidgetBuilder? builder, Widget? child, ScreenPageBuilder? pageBuilder, bool? isGlobalOnly, bool deepLinkAllowed = true, bool? mustBeAuthorized, RouterRedirect? redirect, bool? isPopupRoute, bool shouldReplaceAll = false, bool isTopLevelOnly = false, List<
String> deepLinkNames = const [], DeepLinkHandler? deepLinkHandler, DuplicateRouteBehavior? duplicateBehavior, RoutePolicy? policy, String? path}) -
Creates a standard navigation route.
const
-
RouteInfo.branch(String name, {required int? branchIndex, required String? branchKey, required Enum? branchParentType, ScreenTitleBuilder? title, Widget? child, ScreenWidgetBuilder? builder, ScreenPageBuilder? pageBuilder, bool deepLinkAllowed = true, bool? mustBeAuthorized, bool shouldReplaceAll = false, bool isTopLevelOnly = false, List<
String> deepLinkNames = const [], DeepLinkHandler? deepLinkHandler, DuplicateRouteBehavior? duplicateBehavior, RoutePolicy? policy, String? path}) -
Creates a route that belongs to a navigation shell (e.g., tab navigation).
const
-
RouteInfo.redirect(String name, {required RouterRedirect? redirect, ScreenTitleBuilder? title, bool? isGlobalOnly, bool deepLinkAllowed = true, bool? mustBeAuthorized, bool isTopLevelOnly = false, List<
String> deepLinkNames = const [], DeepLinkHandler? deepLinkHandler, DuplicateRouteBehavior? duplicateBehavior, RoutePolicy? policy, String? path}) -
Creates a route that only performs redirection.
const
Properties
- branchIndex → int?
-
Position of this branch within its shell, if isBranch is true.
final
- branchKey → String?
-
Unique navigator key identifier for branch routes.
final
- branchParentType → Enum?
-
Enum discriminator used to group branch routes.
final
- builder → ScreenWidgetBuilder?
-
Builds the widget for this route when navigation occurs.
final
- child → Widget?
-
Static widget instance for routes that do not require a builder.
final
- deepLinkAllowed → bool
-
Whether this route can be accessed via deep links.
final
- deepLinkHandler → DeepLinkHandler?
-
Handler for complex deep link logic beyond navigation.
final
-
deepLinkNames
→ List<
String> -
Alternative names for deep link matching.
final
- duplicateBehavior → DuplicateRouteBehavior?
-
Duplicate behavior override for this route.
final
- forRedirectionOnly → bool
-
Whether this route is used solely for redirections.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isBranch → bool
-
Whether this route belongs to a navigation shell.
final
- isGlobalOnly → bool?
-
Whether this route should only be pushed on the root navigator.
final
- isPopupRoute → bool?
-
Whether this route is presented as a popup or dialog.
final
- isTopLevelOnly → bool
-
Whether this route should stay at the top level of its navigator.
final
- mustBeAuthorized → bool?
-
Whether authentication is required to access this route.
final
- name → String
-
Unique identifier for this route.
final
- pageBuilder → ScreenPageBuilder?
-
Builds a custom Page for this route, enabling tailored transitions.
final
- path → String
-
The route's path segment. Defaults to '/$name' if not specified.
no setter
- policy → RoutePolicy?
-
Comprehensive policy for this route.
final
-
props
→ List<
Object?> -
Fields used by
Equatablefor equality checks.no setter - redirect → RouterRedirect?
-
Redirect handler for conditional navigation logic.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- shouldReplaceAll → bool
-
This route will replace all existing routes in the stack when navigated to.
final
- stringify → bool?
-
If set to
true, thetoStringmethod will be overridden to output this instance'sprops.no setterinherited - title → ScreenTitleBuilder?
-
Localized title provider for this route.
final
-
Whether primary navigation UI should remain visible on this route.
final
Methods
-
generateName(
{RouteInfo? parentRoute}) → String -
Builds a hierarchical name optionally scoped under
parentRoute. -
generatePath(
{RouteInfo? parentRoute}) → String -
Builds a hierarchical path optionally scoped under
parentRoute. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
report(
) → Map< String, Object?> - Produces an inspection-friendly map describing this route.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited