isEmpty property

bool isEmpty

Whether this collection has no elements.

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

このコレクションに要素がないかどうかを調べます。

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

Example:

final emptyList = <int>[];
print(emptyList.isEmpty); // true;
print(emptyList.iterator.moveNext()); // false

Returns true if itself is Null.

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

Implementation

bool get isEmpty {
  if (this == null) {
    return true;
  }
  return this!.isEmpty;
}