addIfNonNull method
Adds the element to this set and returns true if it is not null.
{}.addIfNonNull(1); // {1}, true
{}.addIfNonNull(null); // {}, false
Implementation
bool addIfNonNull(E? element) => element != null && add(element);
Adds the element to this set and returns true if it is not null.
{}.addIfNonNull(1); // {1}, true
{}.addIfNonNull(null); // {}, false
bool addIfNonNull(E? element) => element != null && add(element);