setProperty method
Updates or adds a property (resets signature).
Modifying properties invalidates the existing signature (both isValid and the stored signature will be reset). A new signature must be generated with sign() after making changes.
name: Name of the property to update/add
value: New value for the property (may be null to remove)
Implementation
@override
void setProperty(String name, Object? value) {
// 1. reset status
assert(_status >= 0, 'status error: $this');
_status = 0;
// 2. update property value with name
Map? dict = properties;
if (dict == null) {
assert(false, 'failed to get properties: $this');
} else if (value == null) {
dict.remove(name);
} else {
dict[name] = value;
}
// 3. clear data signature after properties changed
remove('data');
remove('signature');
_json = null;
_sig = null;
}