xproxy<E, A> function

ProxyProvider<A, E> xproxy<E, A>(
  1. LifecycleAwareContextBuilder2<E, A> create, {
  2. bool lazy = true,
  3. Widget? child,
})

Implementation

ProxyProvider<A, E> xproxy<E, A>(LifecycleAwareContextBuilder2<E, A> create,
        {bool lazy = true, Widget? child}) =>
    ProxyProvider<A, E>(
      update: (c, a, s) => s ?? trying(() => create(c, a)),
      dispose: (context, final value) {
        if (value is LifecycleAware) {
          value.dispose();
        }
      },
      lazy: lazy,
      child: child,
    );