dispose method Null safety

void dispose()

Implementation

void dispose() {
  if (isValid) {
    malloc.free(pointer!);
    pointer = null;
    bytes = null;
  }
}