addIfNotNull method

Map<String, dynamic> addIfNotNull(
  1. String key,
  2. dynamic value
)

Implementation

Map<String, dynamic> addIfNotNull(String key, dynamic value) {
  if (value != null && value is Object) {
    putIfAbsent(key, () => value);
  } else if (value != null) {
    putIfAbsent(key, () => value as dynamic);
  }
  return this;
}