addProp method
Adds an arbitrary propKey
/value
pair if shouldAdd
is true
.
Is a noop if shouldAdd
is false
.
Related: addProps
Implementation
void addProp(propKey, value, [bool shouldAdd = true]) {
if (!shouldAdd) return;
this[propKey] = value;
}