findOrNull<S> method
The findOrNull method will return the instance if it is registered; otherwise, it will return null.
Implementation
S? findOrNull<S>({String? tag}) {
if (isRegistered<S>(tag: tag)) {
return find<S>(tag: tag);
}
return null;
}