dispose method

Future<void> dispose()

Disposes the data source. This should not be called directly. DataSource is disposed automatically when no longer needed for clipboard or drag and drop by ClipboardWriter and DragContext.

Implementation

Future<void> dispose() async {
  if (!_disposed) {
    _disposed = true;
    _onDispose.notify();
    _onDispose.dispose();
    await DataProviderManager.instance.unregisterDataProvider(id);
  }
}