getInstance<T extends Module> method

T getInstance<T extends Module>(
  1. String name
)

Implementation

T getInstance<T extends Module>(String name)
{
  if (_factories.containsKey(name))
  {
    return _factories[name]!() as T;
  }
  else
  {
    throw Exception("Class with name '$name' not registered");
  }
}