Open UlyssesAlves opened 11 months ago
Wrap the node widget in a ValueListenableBuilder
, and use the node.listenableData
as the value
to listen. Use node.data
to assign or get the data.
The node extends the ValueListenable
, so it can be used as a ChangeNotifier
or ValueListenable
.
Apologize for the late reply.
//sample code
ValueListenableBuilder(
valueListenable: node.listenableData,
builder: (context, page, child) {
return SomeWidgetHere();
},
);
I need a tree with a checkbox on each of its nodes. My current problem is that the checkbox ui state does not change right after I click the checkbox for that node, but it is then updated correctly when I expand or shrink the tree.
How can I make this work so that when a checkbox os pressed it's UI wii change too on the node?