rrousselGit / flutter_hooks

React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
MIT License
3.07k stars 175 forks source link

Is it possible to add useAutoScrollController? #364

Closed xzghx closed 1 year ago

xzghx commented 1 year ago

Hi, Is it possible to add useAutoScrollController? I use scroll_to_index package for list view scrolling and I would like to instantiate it's controller which is of type AutoScrollController in hook.

rrousselGit commented 1 year ago

Sure. Feel free to make a PR

rrousselGit commented 1 year ago

Wait, sorry, I misunderstood what this is about.

No. Since AutoScrollController is from a package instead of Flutter itself, it does not belong in flutter_hooks.

But you could ask the author of the package you're using to package a hook package for scroll_to_index. Or you could make the hook yourself in your project.