add<T> method
Stores init
Factory for later use - ControlFactory.init or ControlFactory.get.
Implementation
void add<T>({Type? key, required InitFactory<T> init}) {
key ??= T;
assert(() {
if (_factory.containsKey(key)) {
printDebug(
'Factory already contains key: $key. Value of this key will be override.');
}
return true;
}());
_factory[key] = init;
}