WtRouter class
Matches route names to WtRoutes and generates their pages.
Constructors
-
WtRouter({required List<
WtRoute> routes, String initialRoute = '/', Widget notFoundPage(BuildContext, RouteSettings)?}) -
Creates a router over
routeswith aninitialRoute.const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialRoute → String
-
Route shown first when the app starts.
final
- notFoundPage → Widget Function(BuildContext, RouteSettings)?
-
Optional custom page for unmatched routes (defaults to a built-in 404).
final
-
routes
→ List<
WtRoute> -
The registered routes, matched in order.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispatch(
RouteSettings settings) → Route? -
onGenerateRoutehandler: resolvessettingsto a page or the 404. -
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