DeferredInheritedProvider<T, R> constructor

DeferredInheritedProvider<T, R>({
  1. Key? key,
  2. required Create<T> create,
  3. Dispose<T>? dispose,
  4. required DeferredStartListening<T, R> startListening,
  5. UpdateShouldNotify<R>? updateShouldNotify,
  6. bool? lazy,
  7. TransitionBuilder? builder,
  8. Widget? child,
})

Lazily create an object automatically disposed when DeferredInheritedProvider is removed from the tree.

The object create will be listened using startListening, and its content will be exposed to child and its descendants.

Implementation

DeferredInheritedProvider({
  Key? key,
  required Create<T> create,
  Dispose<T>? dispose,
  required DeferredStartListening<T, R> startListening,
  UpdateShouldNotify<R>? updateShouldNotify,
  bool? lazy,
  TransitionBuilder? builder,
  Widget? child,
}) : super._constructor(
        key: key,
        child: child,
        lazy: lazy,
        builder: builder,
        delegate: _CreateDeferredInheritedProvider(
          create: create,
          dispose: dispose,
          updateShouldNotify: updateShouldNotify,
          startListening: startListening,
        ),
      );