Is possible to disable ListView Scroll if page don't overflow the screen size?
I always use ListView to avoid overflow the screen, but when the content of the page is smaller than screen I can see the end scroll animation, how can i disable the scroll in this cases, and able to scroll if the screen size is small??
You can make the ListView widget never scrollable by setting physics property to NeverScrollableScrollPhysics().
ListView itself is scrollable.
You can provide physics: NeverScrollableScrollPhysics() on GridView to disable scroll effect.
You can set the scroll physics property on the ListView, which will disable scrolling:
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
You can also switch between enabling or disabling scrolling at runtime if you have to via some condition like so:
shrinkWrap: true,
physics: disableScrolling ? NeverScrollableScrollPhysics() :
AlwaysScrollableScrollPhysics(),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With