ListenableProxyProvider0<R extends Listenable> constructor

ListenableProxyProvider0<R extends Listenable>(
  1. {Key key,
  2. @required Create<R> create,
  3. @required R update(
    1. BuildContext,
    2. R previous
    ),
  4. Dispose<R> dispose,
  5. UpdateShouldNotify<R> updateShouldNotify,
  6. bool lazy,
  7. TransitionBuilder builder,
  8. Widget child}
)

Initializes key for subclasses.

Implementation

ListenableProxyProvider0({
  Key key,
  @required Create<R> create,
  @required R Function(BuildContext, R previous) update,
  Dispose<R> dispose,
  UpdateShouldNotify<R> updateShouldNotify,
  bool lazy,
  TransitionBuilder builder,
  Widget child,
})  : assert(create != null || update != null),
      super(
        key: key,
        create: create,
        update: update,
        lazy: lazy,
        builder: builder,
        dispose: dispose,
        updateShouldNotify: updateShouldNotify,
        startListening: ListenableProvider._startListening,
        debugCheckInvalidValueType: kReleaseMode
            ? null
            : (value) {
                if (value is ChangeNotifier) {
                  // ignore: invalid_use_of_protected_member
                  assert(value.hasListeners != true);
                }
              },
        child: child,
      );