isNullOrEmpty property

bool get isNullOrEmpty

Returns true if this nullable map is either null or empty.

Example:

Map<String, int>? map1 = null;
print(map1.isNullOrEmpty); // true

Map<String, int>? map2 = {};
print(map2.isNullOrEmpty); // true

Map<String, int>? map3 = {"a": 1};
print(map3.isNullOrEmpty); // false

Implementation

bool get isNullOrEmpty => this == null || this!.keys.isNullOrEmpty;