본문 바로가기
개발/Flutter

[Flutter] ListView scroll 막기

by kamyiho 2022. 2. 18.
728x90

 

ListView 또는 SingleChildScrollView 안에 또 다른 vertical Listview가 있을 때 스크롤 막기

  • physics: const NeverScrollableScrollPhysics(),
  • primary: false
return ListView(
	children: [
    	Row(...),
        ListView.builder(
            physics: const NeverScrollableScrollPhysics(), // 1번 방법
            primary: false, // 2번 방법
        ),
    ],
)

 

참고

https://stackoverflow.com/questions/56131101/how-to-place-a-listview-inside-a-singlechildscrollview-but-prevent-them-from-scr

 

how to place a listview inside a SingleChildScrollView but prevent them from scrolling separately?

I have a widget tree like this: SingleChildScrollView Column Container ListView(or GridView) the problem is that when my widget tree is like above, it gives me error of NEEDS PA...

stackoverflow.com

 

 

반응형

'개발 > Flutter' 카테고리의 다른 글

[Flutter] 스플래시 적용하기  (0) 2022.03.15
[Flutter] model class 자동으로 만들기  (0) 2022.02.20
[Flutter] Bottom Sheet  (0) 2022.02.15
[Flutter] Google Map 연동  (0) 2022.02.04
[Flutter] bottom overflowed by ~ pixels  (0) 2022.02.03

댓글