akshathjain / sliding_up_panel

A draggable Flutter widget that makes implementing a SlidingUpPanel much easier!
https://pub.dartlang.org/packages/sliding_up_panel
Other
1.36k stars 377 forks source link

Scrolling the sliding up panel's Scroll Position to the top from an onPress in the App drawer #294

Open Sam-Guru-In-Training opened 2 years ago

Sam-Guru-In-Training commented 2 years ago

I've spent probably over a week's worth of time trying to solve this problem and instead creating new glitches.

Essentially when I select a new item from my app drawer it populates the Sliding up panel with new data, but the panel remains at the Scroll Position of the old data, I can't refresh the ScrollPosition. This is bad UX.

I'm using the canonical way to pass a ScrollController through to my panel builder, but that makes it a local ScrollController I can't manipulate from my app Drawer.

  1. I tried putting a listener on the local ScrollController but that caused the panel to seize up, panel sliding events would register with no response from the panel. I expect the plugin has listeners for sliding events that my listener interfered with, or superseded.
  2. I've also tried using a global ScrollController for the panel, and not passing it through. But this caused a worse effect, when the user scrolled up the panel the content scrolled up but simultaneously the panel drew down. Ug!

Anyway, I've put a massive BOUNTY ON StackOverflow +200 for this problem. I would love folk to submit suggestions.

I would love to use the plugin again for other projects but if I can't reset the Scroll Position to the top it's just not possible.