setValue abstract method

void setValue(
  1. Object? instance,
  2. dynamic value
)

Sets the field's value on an instance.

Parameters:

  • instance: The object instance (null for static fields)
  • value: The new value to set

Throws:

  • AccessError if field is not writable
  • TypeError for invalid value types
  • FinalFieldError when modifying final fields

Example:

field.setValue(instance, newValue);

Implementation

void setValue(Object? instance, dynamic value);