BlocResolver<T extends Bloc, R> class final

Creates and caches bloc instances on the fly

Guarantees compile time safety (no more Bloc does not exist)

Constructors

BlocResolver(ArgBlocBuilder<T, R?> _builder)

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

call({R? arg, bool useCache = true}) → T
Redirects to create
clearCache() → void
Clears cached blocs only of type T
create({R? arg, bool useCache = true}) → T
Creates a new bloc, or retrieves a cached one
inject(T bloc) → void
Injects a bloc into this resolver
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeInjection() → void
Removed the injected bloc, and restores normal bloc creation
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

cachedBlocs Iterable<Bloc>
no setter

Static Methods

clearAllCaches() → void
Removes all cached blocs of all types