operator []= method

void operator []=(
  1. String fieldName,
  2. dynamic value
)

Implementation

operator []=(String fieldName, dynamic value) {
  final field = value.fields.firstWhere(
    (field) => field.name == fieldName,
    orElse: () => throw ArgumentError('Unknown field $fieldName'),
  );

  field.value = value;
}