register<T> method

void register<T>(
  1. T factory(), {
  2. Type? type,
})

Implementation

void register<T>(T Function() factory, {Type? type}) {
  _factories[type ?? T] = factory;
}