Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree View disordered if id greater than 10 #11

Open
minganp opened this issue Jun 11, 2021 · 0 comments
Open

Tree View disordered if id greater than 10 #11

minganp opened this issue Jun 11, 2021 · 0 comments

Comments

@minganp
Copy link

minganp commented Jun 11, 2021

Tree View disordered if id greater than 10.
I sugest you change like this:
_buildTreeView() {
var k = widget.data
.where((data) {
return data.getParentId() == widget.config.rootId;
})
.map((data) {
return data.getId();
})
.toSet()
.toList()
..sort((i, j) => int.parse(i).compareTo(int.parse(j)));

var widgets = List<ParentWidget>();
k.forEach((f) {
  ParentWidget p = buildWidget(f, null);
  if (p != null) widgets.add(p);
});
setState(() {
  treeView = widgets;
});

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant