unregister<T> method
Removes the entry previously registered for the type T
.
If name
is set, removes the one registered for that name.
Implementation
void unregister<T>([String? name]) {
if (!silent && !(_providers[name]?.containsKey(T) ?? false)) {
throw KiwiError(
'Failed to unregister `$T`:\n\nThe type `$T` was not registered${name == null ? '' : ' for the name `$name`'}\n\nMake sure `$T` is added to your KiwiContainer and rerun build_runner build\n(If you are using the kiwi_generator)\n\nWhen using Flutter, most of the time a hot restart is required to setup the KiwiContainer again.');
}
_providers[name]?.remove(T);
}