bindChangeNotifier<T> function

NotifierBinding<T> bindChangeNotifier<T>({
  1. required Binding<T> binding,
  2. required ChangeNotifier changeNotifier,
  3. required VoidCallback notifyListener,
  4. required VoidCallback onChange,
})

Implementation

NotifierBinding<T> bindChangeNotifier<T>({
  required Binding<T> binding,
  required ChangeNotifier changeNotifier,
  required VoidCallback notifyListener,
  required VoidCallback onChange,
}) {
  var notifierBinding = NotifierBinding<T>(
    binding: binding,
    notifier: changeNotifier,
    notifyListener: notifyListener,
    onChange: onChange,
  );
  binding.context.dependOnInheritedWidgetOfExactType<DependentManager>(
    aspect: NotifierDependentExecutor<T>(notifierBinding),
  );
  return notifierBinding;
}