registerWithDataProvider method

FutureOr<DataProviderHandle> registerWithDataProvider(
  1. DataProvider provider
)

Implementation

FutureOr<raw.DataProviderHandle> registerWithDataProvider(
  raw.DataProvider provider,
) {
  final handle = provider.register();
  return handle.then((handle) {
    final onDisposed = this.onDisposed as SimpleNotifier;
    final onRegistered = this.onRegistered as SimpleNotifier;
    handle.onDispose.addListener(() {
      onDisposed.notify();
      onDisposed.dispose();
      onRegistered.dispose();
    });
    onRegistered.notify();
    return handle;
  });
}