Route class
A class that handles route management and request processing for a web application.
This class processes incoming requests, matches them to defined routes, and handles rendering of files or widgets based on the route configuration. It also performs authentication checks and permission validations as required by the routes.
Constructors
-
Route({required List<
WebRoute> routing, required WebRequest rq}) - Creates a Route instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
routing
↔ List<
WebRoute> -
A list of WebRoute objects defining the routing paths and configurations.
getter/setter pair
- rq ↔ WebRequest
-
The WebRequest object representing the current web request.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seenAuth ↔ WaAuthController?
-
An optional WaAuthController instance used for managing authentication.
getter/setter pair
Methods
-
checkAll(
List< WebRoute> routing, {String parentPath = ''}) → Future<bool> - Checks all routes to determine if a request matches any defined route.
-
checkOne(
WebRoute route, String key) → Future< ({bool found, Map< String, Object?> urlParams})> - Checks a single route to see if it matches the given key.
-
checkPermission(
WaAuthController? auth) → Future< bool> - Checks if the current request has the required permissions.
-
getFileFromPublic(
String path) → File - Retrieves a file from the public directory based on the provided path.
-
getParamsPath(
String clientPath, String serverPath) → (String, Map< String, Object?> ) - Extracts parameters from the client path and server path.
-
getPublicDirectory(
String? filePath) → String - Constructs the full path to a file in the public directory.
-
handel(
) → void - Handles the routing logic by checking all defined routes.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renderFile(
File file) → void - Renders a file by streaming its content to the response.
-
renderWidget(
String uri) → void -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited