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

Body overlap question #249

Open GrbavaCigla opened 3 years ago

GrbavaCigla commented 3 years ago

Hi,

I have set up SlidingUpPanel in recommended way, but it is overlapping ListView in body. How do I make it not overlap?

Thanks in advance and sorry for my noobish question.

RickVM commented 3 years ago

Seems the body doesn't take into account the size of the collapsed player. Since these are shown together in a stack, the body will be hidden if height is bigger than screensize - collapsedPlayer.

You can fix this by setting the height of the slidingPanel with the minHeight property (which controls the collapsed player), and by wrapping the listView in a SizedBox with screensize - collapsedPlayerHeight.

In my case I also had a bottom navigation bar, so I also took into account the bottomNavigation height.

SlidingUpPanel(
           minHeight: kCollapsedPlayerHeight,
  body: myWidget()
)

// MyWidget

    return SizedBox(
      height: MediaQuery.of(context).size.height - kBottomNavigationBarHeight - kCollapsedPlayerHeight,
      child: currentItem != null && currentItem.shows != null ? ListView.builder(
          itemCount: currentItem.shows.length,
          itemBuilder: (context, index) {
        return ShowItem(show: currentItem.shows[index]);
      })
GrbavaCigla commented 3 years ago

Thank you, sorry for my late response. I cant limit body because panel is rounded and clipping is then visible. I tried making element in body same height as panel, but for some reason (even though heights are the same) height of element in body gets overlapped.

nguyendangkhoi commented 3 years ago

same issues

Fethi-Hamdani commented 2 years ago

same issue here