tryGet<T> method
Request an instance by Type that when throwing an
exception returns null.
transform
: Transform a param. This can be used for example
to replace an instance with a mock in tests.
When key
is provided it will search the instance that have the same key
Implementation
@override
T? tryGet<T>({ParamTransform? transform, String? key}) {
try {
return get<T>(transform: transform, key: key);
} catch (e) {
return null;
}
}