isEmpty property

  1. @override
bool get isEmpty
override

Returns true if the last dimension is empty or if it only contains nulls.

Implementation

@override
bool get isEmpty {
  List<NdArray> lastDimension = extractDimension(numDimensions);

  for (NdArray ndArray in lastDimension) {
    if (ndArray.data.isNotEmpty) {
      for (dynamic element in ndArray.data) {
        if (element != null) return false;
      }
    }
  }

  return true;
}