Scope class final
Per-request/job/command/test storage created by Container.runScoped.
Properties
- container → Container
-
The owning container.
final
- disposed → bool
-
Whether dispose has already run.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- name → String
-
Scope name, e.g.
request,job,command,test.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
dispose(
) → Future< void> - Runs all dispose callbacks in reverse order. A failing callback does not prevent the others from running; failures are collected into a ScopeDisposeException.
-
get<
T extends Object> ({String? name}) → T? -
Returns the scoped instance of
T, if one was created or put. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
FutureOr< void> callback()) → void - Registers a callback executed (LIFO) when the scope is disposed.
-
put<
T extends Object> (T instance, {String? name}) → void -
Stores
instanceas the scoped instance ofT. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited