exceptNullAndEmpty method

Map<K, V?> exceptNullAndEmpty()
  • return the map without key of null values and empty

Implementation

Map<K, V?> exceptNullAndEmpty() {
  final holder = Map<K, V?>.of(this);
  holder.removeWhere(
    (key, value) => value == null || value is String && value.isEmpty,
  );
  return holder;
}