SafeNestedRoute class
A container for grouping multiple routes under a common path.
Works like a "namespace" for routes, so you can organize related SafeRoute instances together.
Example:
final userRoute = SafeRoute<String, void>(
name: '/profile',
builder: (_, username) => UserProfilePage(username: username),
);
final settingsRoute = SafeRoute<void, bool>(
name: '/settings',
builder: (_, __) => SettingsPage(),
);
final accountRoutes = SafeNestedRoute(
name: '/account',
routes: [userRoute, settingsRoute],
);
final router = SafeRouter()
..registerAll([accountRoutes]);
// Full paths will be:
// "/account/profile"
// "/account/settings"
Constructors
-
SafeNestedRoute({required String name, required List<
RouteNode> routes}) - Creates a nested route container.
Properties
- fullPath → String
-
The full path of this route, including all parent paths.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Route path fragment (relative to its parent).
finalinherited
- parent ↔ RouteNode?
-
Get parent route
getter/setter pairinherited
-
routes
→ Map<
String, RouteNode> -
All child routes registered inside this nested route.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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