RouteModule<T extends RouteUri> class
abstract
Base class for route modules that handle a subset of application routes.
A route module encapsulates a group of related routes, their navigation paths, layouts, and route parsing logic. This enables modular architecture where different parts of the application can be developed independently.
Role in Navigation Flow
Route modules work with CoordinatorModular:
- When CoordinatorModular.parseRouteFromUri is called, it iterates through modules
- Each module's parseRouteFromUri is tried in order
- First non-null route wins - module order matters
- If all modules return null,
notFoundRouteis called
Module Responsibilities
- Parse routes: Implement parseRouteFromUri for URI patterns
- Define paths: Override paths for nested navigation
- Register layouts: Override defineLayout for layout constructors
- Register converters: Override defineConverter for restorable converters
Constructors
-
RouteModule(CoordinatorModular<
T> coordinator) - Creates a route module with a reference to its coordinator.
Properties
-
coordinator
→ CoordinatorModular<
T> -
The coordinator that owns this module.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
paths
→ List<
StackPath< RouteTarget> > -
The navigation paths managed by this module.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
defineConverter(
) → void - Defines restorable converters for this module.
-
defineLayout(
) → void - Defines layouts for this module.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
parseRouteFromUri(
Uri uri) → FutureOr< T?> - Parses a URI and returns a route if this module handles it.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited