In Flutter, how can a child widget prevent the scrolling of its scrollable parent?

前端 未结 1 1538
孤街浪徒
孤街浪徒 2021-01-12 07:20

I have a scrollable widget, say a ListView, which contains some special widget.

How can I prevent the scrollable to scroll when the user tries to scroll by starting

1条回答
  •  太阳男子
    2021-01-12 07:48

    Wrap the widget with GestureDetector and implement empty gesture functions in it.

    GestureDetector(
       onVerticalDragUpdate: (_) {},
       child: YourWidget
    ),
    

    0 讨论(0)
提交回复
热议问题