ArgumentValueHolder constructor

ArgumentValueHolder({
  1. Map<String, Object?> namedArgs = const {},
  2. List<Object?> positionalArgs = const [],
  3. List<ArgumentValue> arguments = const [],
})

Argument Value Holder

Represents a structured container for arguments (both positional and named) passed to constructors, methods, or functions within the dependency injection / reflection framework.

Purpose

  • Provides a unified abstraction for storing arguments in different forms:
  • Useful when invoking executables (constructors/methods) reflectively, allowing consistent handling of parameter passing regardless of origin.

Behavior

  • Defaults to empty argument sets if none are provided.
  • Immutable references to the provided maps/lists ensure predictable argument evaluation.
  • Can be extended to carry additional metadata (see ExecutableHolder).

Example

final args = ArgumentValueHolder(
  namedArgs: {'timeout': 30},
  positionalArgs: ['db_connection'],
  arguments: [ArgumentValue.named('timeout', 30)],
);

print(args.namedArgs['timeout']);    // 30
print(args.positionalArgs.first);    // "db_connection"
print(args.arguments.first.name);    // "timeout"

Notes

  • Serves as the base class for ExecutableHolder.
  • Primarily used internally when resolving or invoking pods.

Implementation

ArgumentValueHolder({
  this.namedArgs = const {},
  this.positionalArgs = const [],
  this.arguments = const [],
});