Scope class
Represents a scope, that you can use to retrieve what it holds.
Constructors
- Scope(dynamic builder(ScopeBuilder builder))
- Main way to define a scope with a ScopeBuilder that allows you to define the providers for the dependencies.
-
Scope.fromScopes(List<
Scope> scopes) -
Returns a new Scope that has all the providers from all the scopes
in the
scopes
list.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
debug(
) → dynamic - Prints a text representation of the scope to the console.
-
get<
T> ({dynamic qualifier}) → T -
Retrieves
T
from the scope with its provider. Throws if a provider is not available forT
. -
getMap<
T extends Map> ({dynamic qualifier}) → T -
Combines all providers in the map multibinding of
T
into a single map and returns it. -
getProvider<
T> ({dynamic qualifier}) → T Function() -
Returns a function that can later be used to obtain
T
with its provider in the scope. -
getSet<
T extends Set> ({dynamic qualifier}) → T -
Combines all providers in the set multibinding of
T
into a single set and returns it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
override(
List< Scope> scopes) → Scope -
Uses all the providers of the scopes from
scopes
to override providers in the current scope. -
scope<
S> (S owner) → Scope -
Creates a new scope that provides
owner
as "scoped". -
scopeProvided<
S> ({dynamic qualifier}) → Scope -
Creates a new scope that provides a dependency with the type
S
which is automatically created using a provider from the current scope. -
scopeProvider<
S> (S owner) → Scope Function() -
Returns a function that can later be used to obtain a new scope
that provides
owner
as "scoped". -
scopeProviderProvided<
S> ({dynamic qualifier}) → Scope Function() -
Returns a function that can later be used to obtain a new scope
that provides a dependency with the type
S
which is automatically created at the time of the new scope's creation using a provider from the current scope. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited