RouteDefiner class

Defines a single route in the app with its path, widget builder, authorization requirement, and optional guards.

Constructors

RouteDefiner.new({required String path, required Widget builder(BuildContext context, RouteState state), Future<bool> isAuthorized(CurrentRoute currentRoute)?, Map<String, Object>? data, Future<String> title()?, List<RouteGuard> guards = const [], RouteOptions? options})
Creates a new RouteDefiner.

Properties

builder Widget Function(BuildContext context, RouteState state)
The widget builder function that builds the page for this route.
final
data Map<String, Object>?
Arbitrary data associated with the route which can be consumed by widgets or middleware.
final
guards List<RouteGuard>
List of route guards to control access or redirection for this route.
final
hashCode int
The hash code for this object.
no setterinherited
isAuthorized Future<bool> Function(CurrentRoute currentRoute)?
Optional authorization check that returns true when the user is allowed to access this route.
final
options RouteOptions?
Optional route-specific overrides for MaterialPageRoute behavior.
final
path String
The path pattern of the route, e.g., '/user/:id'.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title Future<String> Function()?
Lazily evaluated title used by TitleObserver when updating the browser or app bar title.
final

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