0

I have a GestureDetector inside a ListView and a CustomFilter widget in my Scaffold. When I filter or change me showList in CustomFiter Widget it seems to be updated because I print the correct value from my CustomValueNotifier. When it comes to my parent widget which is supposed to show my showList inside the GestureDetector the value is not updated at all and is at all times an empty list. So the problem seems to be between the connection of my parent widget which hold both the filter widget, which upadtes the list, and my CustomValueNotifier, which takes the updated value but as I said before does not provide it at the widget. Right now I also do the onnection with getter and setter so in the code im goin to show the showList will be taken the correct value from the getShowList() method. The problem is it doesnt change when the filter is being activated, on change of each filter, but after that when i press somewhere inside the gesturedetector again.

I have tried Change Notifier,Value Notifier, Provider does not seem to be what i can use in this example, setState but of course it updates on click in gestureDetector later

fotis xen
  • 19
  • 1
  • class MyNotifier extends ValueNotifier> { MyNotifier(List value) : super(value); changeMyData(List l) { value = []; for (int i = 0; i < l.length; i++) { value.add(l[i]); } notifyListeners(); print(value.length); } } showList.value MyNotifier showList = MyNotifier(getShowList()); ValueListenableBuilder( valueListenable: showList, builder: (context, value, child) { return CustomScrollView( – fotis xen Jan 26 '23 at 11:31

0 Answers0