putValue function Null safety

void putValue(
  1. String name,
  2. dynamic value,
  3. Map<String, dynamic> map
)

Puts a name and value into the map if value is not null. If value is null, nothing is added.

Implementation

void putValue(String name, dynamic value, Map<String, dynamic> map) {
  if (value != null) {
    map[name] = value;
  }
}