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 S or identified by key or tag.
findAsync<S>({dynamic key, String? tag}) Future<S>
Asynchronously resolves a dependency of type S or identified by key or tag.
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 S has already been instantiated.
isRegistered<S>({dynamic key, String? tag}) bool
Whether type S is registered in the current or any parent scope.
lazyPut<S>(S builder(), {String? tag, bool permanent = false, bool isFactory = false}) → void
Registers a builder that 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 builder for 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 builder if not found.
toString() String
A string representation of this object.
inherited

Operators

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