Reputation: 171
I am using a SingleChildScrollView
and when tapping on FormTextField
in it, the keyboard appears and the scroll view is scrolled upwards. After dismissing the keyboard, I am still able to scroll the Scrollview manually. Can you please suggest any solution to disable the manual scrolling after FormTextField
disappears.
Upvotes: 17
Views: 16408
Reputation: 2090
In my case, when I put physics: NeverScrollableScrollPhysics()
SingleChildScrollView
can't be scrolled, but a scroll bar appears. If I use the scroll bar, the content is scrolled.
I need to hide the scroll bar:
ScrollConfiguration(
behavior:
ScrollConfiguration.of(context).copyWith(scrollbars: false),
child: SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: child,
)),
Upvotes: 5
Reputation: 11
I think we have the same problem. I use two settings in singleChildScrollView
physics: NeverScrollableScrollPhysics(), reverse: true,
This solution is acceptable to me, I hope it is good for you.
Upvotes: -2
Reputation: 1835
You can use the following code in your singleChildScrollView.
physics: NeverScrollableScrollPhysics(),
It stops it from being able to scroll.
Upvotes: 51