Ref<T> class
Universal reference to any dependency - one type for all use cases
Examples:
final authRef = Ref<AuthService>();
final userRef = Ref<UserService>(tag: 'premium');
final scopedRef = Ref<CheckoutService>(scope: checkoutScope);
Properties
Methods
-
call(
) → T - Get the instance (throws if not found)
-
delete(
{bool force = false}) → bool - Delete the instance
-
exists(
) → bool - Check if instance exists
-
find(
) → T - Get the instance (throws if not found)
-
findOrNull(
) → T? - Find the instance (returns null if not found)
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put(
T instance, {bool isPermanent = false}) → T - Register an eager instance
-
putLazy(
T factory(), {bool isPermanent = false}) → void - Register a lazy factory
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override