findOrNull<S> method
Finds and returns the registered instance of type S if it exists, otherwise returns null.
tagOptional tag to identify the instance.
Implementation
S? findOrNull<S>({String? tag}) {
if (isRegistered<S>(tag: tag)) {
return find<S>(tag: tag);
}
return null;
}