removeFromCache static method
Removes blocs from the cache
If a type
is provided then all blocs of that type are removed.
If a bloc
is provided then that specific bloc is removed
Implementation
static void removeFromCache({Type? type, Bloc? bloc}) {
assert(type != null || bloc != null);
if (type != null) {
_cache.removeWhere((key, value) => key.type == type);
} else if (bloc != null) {
_cache.removeWhere((key, value) => value == bloc);
}
}