addExtension method

void addExtension (Extension extension, dynamic value)

Adds an extension field value to a repeated field.

The backing List will be created if necessary. If the list already exists, the old extension won't be overwritten.


void addExtension(Extension extension, var value) {
  if (!extension.isRepeated) {
    throw new ArgumentError(
        'Cannot add to a non-repeated field (use setExtension())');