operator + method
Addition operator.
If the current value is not null
, adds other
to it, updates the value, and returns the new value.
If the current value is null
, returns null
.
Implementation
num? operator +(num other) {
if (value != null) {
value = value! + other;
return value;
}
return null;
}