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

前端 未结 1 1541
孤街浪徒
孤街浪徒 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)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题