fill<K, V> static method

Map<K, V> fill<K, V>(
  1. Map<K, V> map
)

Creates copy of given map and filters out null values. Also empty Iterable or String is not included in returned Map.

Implementation

static Map<K, V> fill<K, V>(Map<K, V> map) => Map.from(map)
  ..removeWhere((key, value) =>
      key == null ||
      value == null ||
      (value is Iterable && value.isEmpty) ||
      (value is String && value.isEmpty));