determineCandidateArguments method
Determines the arguments to use for a specific constructor or factory method.
This method provides fine-grained control over argument resolution, enabling custom dependency resolution logic beyond the standard container capabilities.
Argument Resolution
The returned arguments will be used in place of standard dependency resolution.
If null is returned, the container uses its default argument resolution.
Parameters
@param podName The name of the pod being instantiated
@param executable The constructor or factory method being invoked
@param parameters The parameters that need argument values
@return A list of argument values, or null for default resolution
Example:
@override
Future<List<ArgumentValue>?> determineCandidateArguments(
String podName, Executable executable, List<Parameter> parameters) async {
// Provide custom arguments for specific parameters
return parameters.map((param) {
if (param.hasAnnotation<CustomValue>()) {
return ArgumentValue(param, await resolveCustomValue(param));
}
return null; // Use default resolution for this parameter
}).where((value) => value != null).toList();
}
Implementation
Future<List<ArgumentValue>?> determineCandidateArguments(String podName, Executable executable, List<Parameter> parameters) async => null;