HandlerIdentity class

Identifies a route handler for cross-referencing between runtime registration and static analysis.

Annotations
  • @immutable

Constructors

HandlerIdentity({String? routeName, String? functionRef, String? method, String? path, String? sourceFile, int? sourceLine, int? sourceColumn})
Creates an identity from available components.
const
HandlerIdentity.fromFunction(String ref)
Creates an identity from a function reference name.
const
HandlerIdentity.fromJson(Map<String, Object?> json)
Deserializes from JSON.
factory
HandlerIdentity.fromRoute(String method, String path)
Creates an identity from an HTTP method and path.
const
HandlerIdentity.named(String name)
Creates an identity from a route name.
const

Properties

functionRef String?
The Dart function/method name (e.g. 'createUser').
final
hashCode int
The hash code for this object.
no setteroverride
isResolved bool
Whether this identity has enough information to be useful.
no setter
key String
The canonical identity string, resolved in priority order.
no setter
method String?
The HTTP method (e.g. 'GET', 'POST').
final
path String?
The route path pattern (e.g. '/users/{id}').
final
routeName String?
The explicit route name (e.g. 'users.create').
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceColumn int?
1-based source column for the registration call.
final
sourceFile String?
Source file where the route registration call was made.
final
sourceLine int?
1-based source line for the registration call.
final

Methods

matches(HandlerIdentity other) bool
Returns true if this identity matches other.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, Object?>
Serializes this identity to JSON.
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
override