LevitProvider class
Gateway for finding dependencies from BuildContext.
Proxies calls to the nearest LScope found in the widget tree. If no local scope is found, it falls back to the global Levit scope.
Constructors
- LevitProvider(BuildContext _context)
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
-
find<
S> ({dynamic key, String? tag}) → S -
Resolves a dependency of type
Sor identified bykeyortag. -
findAsync<
S> ({dynamic key, String? tag}) → Future< S> -
Asynchronously resolves a dependency of type
Sor identified bykeyortag. -
findOrNull<
S> ({dynamic key, String? tag}) → S? - Resolves a dependency, or null if not found.
-
findOrNullAsync<
S> ({dynamic key, String? tag}) → Future< S?> - Asynchronously resolves a dependency, or null if not found.
-
isInstantiated<
S> ({dynamic key, String? tag}) → bool -
Whether type
Shas already been instantiated. -
isRegistered<
S> ({dynamic key, String? tag}) → bool -
Whether type
Sis registered in the current or any parent scope. -
lazyPut<
S> (S builder(), {String? tag, bool permanent = false, bool isFactory = false}) → void -
Registers a
builderthat will be executed only when the dependency is first requested. -
lazyPutAsync<
S> (Future< S> builder(), {String? tag, bool permanent = false, bool isFactory = false}) → Future<S> Function() -
Registers an asynchronous
builderfor lazy instantiation. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
put<
S> (S builder(), {String? tag, bool permanent = false}) → S - Instantiates and registers a dependency.
-
putOrFind<
S> (S builder(), {String? tag, bool permanent = false}) → S -
Resolves the dependency, or registers it via
builderif not found. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited