reload<S> method

void reload<S>({
  1. String? tag,
  2. String? key,
  3. bool force = false,
})

Implementation

void reload<S>({
  String? tag,
  String? key,
  bool force = false,
}) {
  final builder = _getDependency<S>(tag: tag, key: key);
  if (builder == null) return;
  if (key != null &&
      ((S != dynamic && builder.registeredType != S) ||
          (tag != null && builder.tag != tag))) {
    throw ArgumentError(
        'Dependency key does not match the supplied type/tag');
  }
  _reloadFactory(builder, force: force);
}