override<T> method

void override<T>(
  1. T key,
  2. T clazz()
)

Implementation

void override<T>(T key, T Function() clazz) {
  if (!_services.containsKey(key)) {
    throw Exception('Service not exists, you can\t override it');
  }

  _services[key as Type] = clazz();
}