isNullAndEmpty property

bool get isNullAndEmpty

Returns true if the list is either null or empty.

Example:

List<num>? list1 = null;
print(list1.isNullAndEmpty); // true

List<num>? list2 = [];
print(list2.isNullAndEmpty); // true

List<num>? list3 = [1, 2, 3];
print(list3.isNullAndEmpty); // false

Implementation

bool get isNullAndEmpty => this == null && this!.isEmpty;