Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter: ListView disable scrolling with touchscreen

Tags:

flutter

dart

Is it possible to let a ListView only be scrollable with the ScrollController and not with the touchscreen?

like image 502
Tobias Gubo Avatar asked May 22 '18 23:05

Tobias Gubo


People also ask

How do I disable scroll in list view Flutter?

You can make the ListView widget never scrollable by setting physics property to NeverScrollableScrollPhysics().

How do I stop GridView scrolling in Flutter?

You can provide physics: NeverScrollableScrollPhysics() on GridView to disable scroll effect.


2 Answers

As mentioned in the comments, the NeverScrollableScrollPhysics class will do this:

NeverScrollableScrollPhysics class

Scroll physics that does not allow the user to scroll.

like image 111
Danny Tuppeny Avatar answered Sep 23 '22 04:09

Danny Tuppeny


Inside ListView widget, use

physics: const NeverScrollableScrollPhysics() 
like image 44
Ankur Kedia Avatar answered Sep 20 '22 04:09

Ankur Kedia