Consider allowing Node to store model data
Issue #3
resolved
If Node can also store model data, then subsequently, it gets easier to access the model when an action is performed on the node (such as tap, double tap).
For example:
Node node = Node(
label: ...
key: ...
...
data: <custom data model object>
)
...
onNodeDoubleTap: (String key) {
Node selectedNode = _treeViewController.getNode(key);
MyModel selectedModel = selectedNode.data;
}
Nice widget, by the way.
Comments (3)
-
-
- changed status to resolved
Fixes issue
#3. Added generic data property to Node class to support the use of custom dataUpdated node_test Updated documentation
→ <<cset 2ca91f5bb2c5>>
-
reporter That was fast! Works as expected. Thanks!
- Log in to comment
Thanks Vansanth. I like that idea. That should be easy enough to implement. Give me a day or so to implement it and test it out.