modal_bottom_sheet
modal_bottom_sheet copied to clipboard
ModalScrollController cannot be used to get scroll position (eg after adding a listener to it)
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()