filterOutNulls function

  1. @visibleForTesting
Map<String, dynamic> filterOutNulls (Map<String, dynamic> parameters)

Creates a new map containing all of the key/value pairs from parameters except those whose value is null.

Implementation

@visibleForTesting
Map<String, dynamic> filterOutNulls(Map<String, dynamic> parameters) {
  final Map<String, dynamic> filtered = <String, dynamic>{};
  parameters.forEach((String key, dynamic value) {
    if (value != null) {
      filtered[key] = value;
    }
  });
  return filtered;
}