putToMapIfNonNull function

void putToMapIfNonNull(
  1. Map param,
  2. dynamic key,
  3. dynamic value
)

A util to put value to json object with key while value is not null.

Implementation

void putToMapIfNonNull(Map param, dynamic key, dynamic value) {
  if (value != null) param.putIfAbsent(key, () => value);
}