Closed Salman3sh closed 1 year ago
HI Salman, I have added an example for using a custom object with TreeNode here
Basically, you will need to wrap the the CustomClass in TreeNode like TreeNode<CustomClass>
, and use one of the typed constructors e.g.TreeView.simpleTyped<CustomClass, TreeNode<CustomClass>>
instead of the simple constructors, as this allows the linter to correctly identify the class type in the builder.
Now you can access your object in the builder like this: builder: (context, level, item) => item.someFieldInCustomClass
Hi,
Currently when adding a new child or node, it is adding a name based on level and key.
What about adding a custom name? Is there any sample for this matter. I am trying to open a dialog to read the name and then I changed the code, but I am receiving some errors.