dispose method Null safety

void dispose()

Disposes of this object.

Once this method has been called, the object should not be used anymore, and no clones of it or the image it contains can be made.

Implementation

void dispose() {
  assert((image.debugGetOpenHandleStackTraces()?.length ?? 1) > 0);
  image.dispose();
}