SpotKey<T> class
Registry key that supports both unnamed and named service registration.
SpotKey allows registering multiple implementations of the same type by differentiating them with an optional name qualifier.
When name is null, the key represents the default/unnamed instance. When name is provided, it creates a named instance that can coexist with other implementations of the same type.
Example:
// Register multiple HTTP clients
final publicKey = SpotKey<HttpClient>(HttpClient, 'public');
final authKey = SpotKey<HttpClient>(HttpClient, 'authenticated');
final defaultKey = SpotKey<HttpClient>(HttpClient); // name = null
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override