getBlocInstance static method
Provide the bloc class cached with blocKey
otherwise instantiates with instance
.
Implementation
static Bloc getBlocInstance(String blocKey, Bloc Function() instance) {
var bloc = BlocCache._cache.blocs[blocKey];
if (bloc != null) {
return bloc;
}
bloc = instance();
BlocCache._cache.blocs[blocKey] = bloc;
return bloc;
}