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.38k stars 381 forks source link

[Feature] Drag Header! #145

Open nhtlquan opened 4 years ago

nhtlquan commented 4 years ago

When scrollview scroll middle body I want drag header to scrollview to top and PanelController scroll with header!!

Look like Zeplin: https://drive.google.com/file/d/1KWbDHGzvExcmY7DN0N8GDDn2-4lkbCcz/view?usp=sharing

OmGaler commented 4 years ago

Have the same issue

RickBoyerDev commented 4 years ago

@nhtlquan @OmGaler

I needed this functionality too and found a way to do it.

If you haven't seen issue #85 , you can use the "minimum height" property (minHeight) to get the effect you want. Don't use the "collapsed" property at all, and instead just use the minHeight and it gives the effect of dragging the header. Pretty cool.

OmGaler commented 4 years ago

@NightSkyDev that sounds like it would work. In the end I found a solution at least to my issue. If you look on the readme I tried the scroll behaviour (I think, can't remember what it was called) with a scroll controller. Problem was, I forgot to link the scroll controller to the widget so I did that and it solved the issue.

ghenry commented 4 years ago

Do you mean changing the icon on slide up panel from a bar to a down arrow as you slide the panel up?

OmGaler commented 4 years ago

No, but that would be pretty cool.

imJithin777 commented 4 years ago

Adding a Singlechildscrollview to the panel but it does not get scrolled....does anyone have a solution for this.

vh13294 commented 4 years ago

@nhtlquan @OmGaler

I needed this functionality too and found a way to do it.

If you haven't seen issue #85 , you can use the "minimum height" property (minHeight) to get the effect you want. Don't use the "collapsed" property at all, and instead just use the minHeight and it gives the effect of dragging the header. Pretty cool.

But the body will still be draggable, I only need header to be draggable.

Please help... I tried this and it's not working

SlidingUpPanel(
      header: Container(
        height: headerHeight,
        width: headerWidth,
        child: Center(
          child: horizontalStrip,
        ),
      ),
      minHeight: 0,
      // isDraggable: false,
      backdropEnabled: true,
      color: Color.fromRGBO(240, 240, 240, 1),
      borderRadius: radius,
      controller: controller,
      slideDirection: SlideDirection.DOWN,
      panel: GestureDetector(
        onVerticalDragUpdate: null, // <-- here
        child: child,
      ),
    );
futurelucas4502 commented 3 years ago

@nhtlquan hi there how did you get the header of the panel to center and change shape as I've been trying and can't seem to figure it out

anasmano commented 3 years ago

When scrollview scroll middle body I want drag header to scrollview to top and PanelController scroll with header!!

Look like Zeplin: https://drive.google.com/file/d/1KWbDHGzvExcmY7DN0N8GDDn2-4lkbCcz/view?usp=sharing

@akshathjain, Any workaround for this ?