# toMap method

Map<String, ArgumentValue> toMap()

Returns a map of argument values, where keys are parameter names and values are ArgumentValues.

Example:

    final args = ConstructorArgumentValues()
      ..add('localhost', 'dart.core.String')
      ..add(8080, 'dart.core.int');

    final map = args.toMap();
    print(map); // { 'localhost': ArgumentValue('localhost', 'dart.core.String'), 'port': ArgumentValue(8080, 'dart.core.int') }

## Implementation

    Map<String, ArgumentValue> toMap() {
      final map = <String, ArgumentValue>{};
      _values.forEach((key, value) {
        if(value.getName() != null) {
          map[value.getName()!] = value;
        } else {
          throw IllegalArgumentException('Argument value must have a name');
        }
      });
      return map;
    }