jamesblasco / modal_bottom_sheet

Flutter | Create advanced modal bottom sheets. Material, Cupertino or your own style
https://pub.dev/packages/modal_bottom_sheet
MIT License
1.86k stars 470 forks source link

ModalScrollController cannot be used to get scroll position (eg after adding a listener to it) #405

Open mrares opened 4 months ago

mrares commented 4 months ago

As soon as I use the ModalScrollController in a SingleChildScrollView inside of a modal bottom sheet, the controller gets two positions attached and addListener cannot be used with the regular controller.offset or controller.position.maxScrollExtent without triggering an error.

As a stop-gap I'm using controller.positions.first but I wonder if this is some kind of mistake on my part or if this is expected.

Prior to using the ModalScrollController I was simply declaring a final _scrollController = ScrollController()