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 379 forks source link

Add a way to attach widgets to the top border #286

Open subzero911 opened 2 years ago

subzero911 commented 2 years ago

That's what I want to achieve image

I know it's not very beautiful, but it's a design I have to do. These choice buttons should move with panel sticking to its top. The problem is I cannot just wrap a panel or header into Stack and use Positioned, because a panel crops everything that is out. image

Now the only way is a dynamically calculate a widget position in onPanelSlide callback, as described in a video below (super inconvenient) https://youtu.be/s9XHOQeIeZg?t=527

Make an option to not to crop outside the panel or an additional field for attached widgets.

subzero911 commented 2 years ago

Oh, the fix above doesn't solve the issue You can draw the widgets outside the Stack but cannot make them clickable. Those buttons will not react to gestures. It's a known issue of the Stack which won't be fixed. https://stackoverflow.com/questions/62258640/flutter-overflowed-positioned-button-is-not-clickable https://github.com/flutter/flutter/issues/19445

So the problem is still open.

subzero911 commented 2 years ago

I used this method https://youtu.be/s9XHOQeIeZg it also has a problem that attached buttons are wobbling when dragging the sheet up and down. See the video: https://disk.yandex.ru/i/0Z4Rn1UVcvM9Ew It's because their positions are recalculated and redrawn in response to the panel dragging, and it slightly delays.