Is there a way to use a component within itself ? Ex: I have comment component and people can comment on other comments, so essentially i want to use the same comment component in this recursive tree structure which could have a dynamic depth. The comment features is exactly the same wether it is a root level comment or a sub comment so unless the same component can be used to dynamically build the tree i don't see any other way. If anyone has done something similar would be great if you can guide. Ex:
Comment 1
........Comment 1.1
........Comment 1.2
.................Comment 1.2.1
.........................,Comment 1.2.1.1
Comment 2
To give an example reference what i am trying to do is more like a comment & replies in any social media platform post (like FB). So it is not a fixed depth of comments. So a comment could be a childcomment to another comment, and at the same time be a parent comment to other sub comments on it (replies). So need to be a recursive structure with a dynamic depth. I do know how to model this using collections. By using a comment collection and having a self reference using a field called "parent_comment".
The problem is the restriction in the FlutterFlow UI builder which doesnt allow recursive structures. So to build the UI i created a Comment Component - which shows the text of the component and collapsed view of the sub comments (ex : 10 replies). On expaneding the sub comments I would want to use the same Comment Component so that this can be rendered dynamically till there are no further subcomments. But this is not allowed in FlutterFlow ui builder as it restricts recursive structures. So not sure how to dynamically build the tree structure of comments and subcomments.
Another example conceptually for a similar tree structure would be a "Folder" structure, where every folder can possibly have a subfolder. So the depth of the tree is dynamic.
Ideally a Tree widget would be used but i dont see that option either.
I hope that sheds more light on the problem. Any guidance on if this is possible or not will be helpful. If not possible i would have to fix UI to have only one level of subcomments and then can follow an approach similar to what you have mentioned.
Regards
Ganesh