register method
void
register(
- dynamic locator,
- dynamic factory(
- dynamic locator
inherited
Registers a component using a factory method.
locator
a locator to identify component to be created.factory
a factory function that receives a locator and returns a created component.
Implementation
void register(locator, factory(locator)) {
if (locator == null) throw Exception('Locator cannot be null');
if (factory == null) throw Exception('Factory cannot be null');
_registrations.add(Registration(locator, factory));
}