operator []= method

void operator []=(
  1. int index,
  2. T value
)

Implementation

void operator []=(int index, T value) {
  fields ??= <T>[];
  if (fields!.length <= index) {
    throw Exception('Index out of range: $index');
  } else {
    fields![index] = value;
  }
}