RouteMatcher class

Handles route matching logic with performance optimization.

Separates static and dynamic routes for faster lookup:

  • Static routes: O(1) hash map lookup
  • Dynamic routes: O(n) sequential search (but smaller n)

Constructors

RouteMatcher(List<Route> _routes)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

findAllMatches(String method, String path) List<RouteMatchResult>
Finds all routes that match the given method and path. Useful for debugging or advanced routing scenarios.
hasMatch(String method, String path) bool
Checks if any route matches the given method and path.
match(String method, String path) RouteMatchResult?
Matches a route for the given method and path. Returns the first route that fits the given method and path.
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