This commit is contained in:
Salvatore Giordano
2021-04-13 10:30:06 +02:00
parent 59b99e1cb2
commit 391eb8c1ce
5 changed files with 57 additions and 82 deletions
@@ -1,6 +1,6 @@
/// Useful extension functions for [Map]
extension MapX on Map {
/// Returns a new map with null keys or values removed
Map<String, dynamic> get nullProtected => {...this as Map<String, dynamic>}
Map<String?, dynamic> get nullProtected => {...this as Map<String?, dynamic>}
..removeWhere((key, value) => key == null || value == null);
}