dispose method Null safety

void dispose()

Implementation

void dispose() {
  if(length != -1)
    malloc.free(_dataPointer.value);

  malloc.free(_dataPointer);

  malloc.free(_elementSizePointer);
  malloc.free(_sizePointer);
  malloc.free(ptr);
}