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

Two panels with SlideDirection.DOWN and SlideDirection.UP at the same time? #285

Open HugoHeneault opened 2 years ago

HugoHeneault commented 2 years ago

Hi there,

Thanks for this awesome pub ! Using it in prod apps, so cooool :)

I'd like to have two panels : one on top, one on bottom. I don't think sliding_up_panel is made this way for now so I'm using something like this :

 Scaffold(
        body: SlidingUpPanel(
            color: Colors.black,
            minHeight: 50,
            maxHeight: 190,
            defaultPanelState: PanelState.OPEN,
            panel: Center(
              child: Text('This is the sliding Widget'),
            ),
            body: Column(
              children: [
                SlidingUpPanel(
                    slideDirection: SlideDirection.DOWN,
                    defaultPanelState: PanelState.OPEN,
                    maxHeight: 140,
                    color: Colors.black,
                    panel: Center(
                      child: Text('This is the sliding Widget'),
                    ),
                    body: Container(
                        color: Colors.red,
                        height: 100,
                        width: MediaQuery.of(context).size.width)),
                Expanded(
                  child: Container(color: Colors.red),
                ),
              ],
            ))))

It works but the top interaction is a bit weird because of the Column resizing its children when the top panel opens. Has anyone find a way to use them in both directions at the same time better than this one?

Thanks!

Recker4244 commented 2 years ago

Any solutions?