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

SingleChildScrollView inside SlidingUpPanel not scrolling on iOS (works perfectly on Android) #156

Closed russellbecky closed 4 years ago

russellbecky commented 4 years ago

I am using a SlidingUpPanel with a panelBuilder that is filled with a SingleChildScroll View widget. I have a maximum extension of 80% of the screen - on Android when the SlidingUpPanel is fully extended, the content inside continues to scroll as expected. On iOS, the SlidingUpPanel extends to 80% but the content in the SingleChildScroll does not scroll any further.

As detailed in the explanation of how to use the widget, I am passing the scroll controller to the SingleChildScrollView and using that as its controller. Is there something additional that I need to do to make it work on iOS?

Thanks for any help possible!


Use of SlidingUpPanel: SlidingUpPanel( controller: _panelController, maxHeight: _getMaxHeight(sharedData.selectedPlayground), minHeight: _getMinHeight(sharedData.selectedPlayground), parallaxEnabled: true, parallaxOffset: .5, body: MapScreen(currentPosition: _currentPosition), panelBuilder: (scrollController) => _getPanelContents( sharedData.selectedPlayground, scrollController), borderRadius: BorderRadius.only( topLeft: Radius.circular(12.0), topRight: Radius.circular(12.0), ), backdropEnabled: true, panelSnapping: false, )


panelBuilder is filled by 1 or 2 potential widgets (both SingleChildScrollViews:

Widget _getPanelContents( PlaygroundData selectedPlayground, ScrollController scrollController) { return selectedPlayground == null ? SearchScreen(scrollController, _panelController) : MarkerDetail( data: selectedPlayground, scrollController: scrollController); }


The SingleChildScroll is defined as:

SingleChildScrollView( controller: scrollController, child: Column( children: [ MarkerSummary(playgroundData: data), MarkerExpanded(playgroundData: data), ], ), )

russellbecky commented 4 years ago

Figured it out - it doesn't work in iOS if parallaxEnabled = true. Setting it to false causes it to stop being able to scroll