Dependency<T extends Object> class

An immutable object describing a dependency. It can be registered in Deps by using Deps.add.

Annotations

Constructors

Dependency({required FutureOr<T> create(Deps deps), T update(Deps deps, T oldValue)?, Stream<Object?> when(Deps deps)?, FutureOr<void> dispose(T value)?, String? debugLabel})
An immutable object describing a dependency. It can be registered in Deps by using Deps.add.
const
Dependency.value(T value)
An immutable object describing a dependency. It can be registered in Deps by using Deps.add.
factory

Properties

create FutureOr<T> Function(Deps deps)
Creates a new instance of T. You can use provided Deps to obtain required dependencies. This callback can be asynchronous to perform long running initialization or await another dependency.
final
debugLabel String?
A debug label to help identify the dependency in logs.
final
dispose → (FutureOr<void> Function(T value)?)
Perform actions to clean up after the object is no longer needed.
final
hashCode int
The hash code for this object.
no setterinherited
key DependencyKey
The key or type of the dependency. It is a unique identifier for the dependency in its Deps.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
update → (T Function(Deps deps, T oldValue)?)
Updates or creates a new instance of the dependency in reaction to changes in other dependencies specified by when.
final
when → (Stream<Object?> Function(Deps deps)?)
Use one of Deps.watch, DepsWatchMany.watch2 etc. to specify which changes you want to observe.
final

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.
inherited