embraceitmobile / animated_tree_view

Animated TreeView based on AnimatedList allows building fully customizable Nodes that can be nested to infinite levels and children.
https://pub.dev/packages/animated_tree_view
MIT License
49 stars 23 forks source link

Add optional parameter to specify type of animation #38

Open cadnza opened 7 months ago

cadnza commented 7 months ago

The default animations on TreeView and SliverTreeView work fine for small lists, but they break down with a large number of complex elements. This PR proposes an optional Animation<double>? animation parameter for each of them (as well as each of their respective constructors) that allows users to specify a custom animation, including suppressing animation altogether.

Omitting the animation parameter defaults animation to the package default, so this PR introduces no breaking changes.

I've also added an optional duration parameter to scrollToItem and scrollToIndex that defaults to the library default.

(Also—this is a feature born purely of self interest. I've got a big tree I'm trying to manage, and this library is perfect for my use case except that the thing freaks out when it tries to animate.)