xprovider<E> function

Provider<E> xprovider<E>(
  1. LifecycleAwareContextBuilder<E> create, {
  2. bool lazy = true,
  3. Widget? child,
})

Implementation

Provider<E> xprovider<E>(LifecycleAwareContextBuilder<E> create,
        {bool lazy = true, Widget? child}) =>
    Provider<E>(
      create: (_) => trying(() => create(_)),
      dispose: (context, final value) {
        if (value is LifecycleAware) value.dispose();
      },
      lazy: lazy,
      child: child,
    );