ScopeAutoDependencies<T extends ScopeAutoDependencies<T, C>, C extends Object?> class abstract Scope

A container that builds its dependency tree and initializes it for you.

T is the class being declared — final class AppDeps extends ScopeAutoDependencies&lt;AppDeps, BuildContext>. It is what init hands the scope on success, so it is what the subtree gets from Scope.of, and the bound is what keeps the two the same thing: naming another container there used to compile and then fail at the end of a successful initialization, with the whole tree already built and nothing left to release it.

C is what buildDependencies is given — a BuildContext when the tree reads scopes above it, void when it needs nothing.

Implemented types

Constructors

ScopeAutoDependencies()

Properties

debugLabel → String
How this object names itself in a report.
no setteroverride
disposesOnError → bool
Whether a failed initialization disposes of what it managed to build.
no setter
hashCode → int
The hash code for this object.
no setterinherited
root → ScopeDependency
The root of the dependency tree.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildDependencies(C context) → ScopeDependency
Build the queue of dependencies.
concurrent(String name, Iterable<ScopeDependency> dependencies) → ScopeDependency
A group whose children are initialized in parallel.
controllerDep<S extends ScopeController>(String name, S create()) → ScopeDependency
A single dependency backed by a ScopeController.
dep(String name, FutureOr<void> init(ScopeDependencyHandle dep)) → ScopeDependency
A single dependency called name.
dispose() → Future<void>
Disposes of the dependencies, releasing any resources they hold.
override
flattenDependencies() → Iterable<ScopeDependencyInfo>
Walks the tree depth-first.
flattenDependenciesWithErrors() → Iterable<ScopeDependencyInfo>
The entries that hold a real error.
init(C context, ScopeInitContext ctx) → Future<T>
Initialize the scope dependencies.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onUnmount() → void
Lets go of whatever cannot wait for dispose.
override
sequential(String name, Iterable<ScopeDependency> dependencies) → ScopeDependency
A group whose children are initialized one after another.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited