dispose method

void dispose()

Closes the underlying NativeCallable and marks this instance as disposed.

Safe to call multiple times, subsequent calls are no-ops. After disposal, accessing nativeFunction will trigger an assertion failure.

Implementation

void dispose() {
  if (_isDisposed) return;
  _isDisposed = true;
  _callable.close();
}