xrr2016 / flutter-tree

Flutter tree widget
https://pub.dev/packages/flutter_tree
MIT License
67 stars 41 forks source link

Improve filter system #13

Closed agostinofiscale closed 2 years ago

agostinofiscale commented 2 years ago

Hi!

I'm using this package for an application that i'm developing. I found it useful and I tried to improve it a little bit.

This PR contains:

  1. A placeholder for the search filter. Now you can add a placeholder text by passing a custom string in the treeview constructor by the filterPlaceholder variable. The Icon aside the data is dynamic. What it means is that before of this PR it appears also if the node doesn't contains children and also if the load function returns an empty list. Now you can see that if there is an empty node the icon will not appear and if the results of a load are none it disappears.
  2. Change the _isExpaned to _isExpanded.
  3. Change expaned to expanded.
  4. Filter system is now case insensitive.
  5. Filter function does now look into widget.data instead of temporany list to avoid lost of data meanwhile you're looking for something.

I hope this can be useful for someone :)