In Flutter I have a SingleChildScrollView
with a Column
with many Text
children.
Besides the Text
children there is one HandSignature
widget (from this package).
When using your finger to draw onto the signature, it would trigger the scroll of the SingleChildScrollView
. Which is why I need to exclude the scrolling behaviour from this widget.
3
Answers
Wrap your HandSignature with NotificationListener like this
Change position of HandSignature to be on AlertDialog
Here’s a way to lock and unlock your scroll. Add a
bool
variable that would be responsible for wether the screen should be scrollable at the moment. change its value when user interacts with signature widget and callsetState
. If scroll is locked, setscrollPhysics
toNeverScrollableScrollPhysics()
, otherwise it should benull
.For simple example I did a button that locks the scroll. You can check this snippet in
Dartpad
.