isNotEmpty property

bool isNotEmpty

Whether this collection has at least one element.

May be computed by checking if iterator.moveNext() returns true.

このコレクションに少なくとも 1 つの要素があるかどうかを調べます。

iterator.moveNext()true を返すかどうかを確認することで計算できます。

Example:

final numbers = <int>{1, 2, 3};
print(numbers.isNotEmpty); // true;
print(numbers.iterator.moveNext()); // true

Returns false if itself is Null.

自身がNullな場合はfalseを返します。

Implementation

bool get isNotEmpty {
  if (this == null) {
    return false;
  }
  return this!.isNotEmpty;
}